github.com/frankrap/okex-api@v1.0.4/futures_params.go (about)

     1  package okex
     2  
     3  /*
     4   OKEX futures contract api request params
     5   @author Tony Tian
     6   @date 2018-03-17
     7   @version 1.0.0
     8  */
     9  
    10  /*
    11   Create a new order
    12   ClientOid: You setting order id.(optional)
    13   Type: The execution type @see file: futures_constants.go
    14   InstrumentId: The id of the futures, eg: BTC_USD_0331
    15   Price: The order price: Maximum 1 million
    16   Amount: The order amount: Maximum 1 million
    17   MatchPrice: Match best counter party price (BBO)? 0: No 1: Yes   If yes, the 'price' field is ignored
    18   LeverRate: lever, default 10.
    19  */
    20  type FuturesNewOrderParams struct {
    21  	InstrumentId string `json:"instrument_id"`
    22  	Leverage     string `json:"leverage"`
    23  	FuturesBatchNewOrderItem
    24  }
    25  
    26  /*
    27    OrdersData: Batch create new orders json string.(Max of 5 orders are allowed per request))
    28  */
    29  type FuturesBatchNewOrderParams struct {
    30  	InstrumentId string `json:"instrument_id"`
    31  	Leverage     string `json:"leverage"`
    32  	OrdersData   string `json:"orders_data"`
    33  }
    34  
    35  type FuturesBatchNewOrderItem struct {
    36  	ClientOid  string `json:"client_oid"`
    37  	Type       string `json:"type"`
    38  	OrderType  string `json:"order_type"`
    39  	Price      string `json:"price"`
    40  	Size       string `json:"size"`
    41  	MatchPrice string `json:"match_price"`
    42  }
    43  
    44  type FuturesClosePositionParams struct {
    45  	ClosePositionData []ClosePositionData
    46  }
    47  
    48  type ClosePositionData struct {
    49  	InstrumentId string `json:"instrument_id"`
    50  	Type         string `json:"type"`
    51  	LeverRate    string `json:"lever_rate"`
    52  }
    53  
    54  /*
    55   Order status: 0: waiting for transaction 1: 1: part of the deal 2: all transactions 3: cancelling 4: canceled.
    56   Currency: futures currencies @see file: futures_constants.go
    57  */
    58  type FuturesOrdersParams struct {
    59  	Currency string
    60  	Status   int
    61  }
    62  
    63  type FuturesFillsParams struct {
    64  	OrderId      string `json:"order_id"`
    65  	InstrumentId string `json:"instrument_id"`
    66  }