v26

latestOpenAPI 3.0.2raw.githubusercontent.com2024-10-0834042975.6 KB
Trade

New Order list - OCO (TRADE)

Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other.

  • An OCO has 2 orders called the above order and below order.
  • One of the orders must be a LIMIT_MAKER order and the other must be STOP_LOSS orSTOP_LOSS_LIMIT order.
  • Price restrictions:
    • If the OCO is on the SELL side: LIMIT_MAKER price > Last Traded Price > stopPrice
    • If the OCO is on the BUY side: LIMIT_MAKER price < Last Traded Price < stopPrice
  • OCOs add 2 orders to the unfilled order count, EXCHANGE_MAX_ORDERS filter, and the MAX_NUM_ORDERS filter.

Weight(IP): 1

post/api/v3/orderList/oco

Query parameters

symbolstring required
Example:BNBUSDT

Trading symbol, e.g. BNBUSDT

listClientOrderIdstring

Arbitrary unique ID among open order lists. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. listClientOrderId is distinct from the aboveClientOrderId and the belowCLientOrderId.

side'SELL' | 'BUY' required
Example:SELL
quantitynumber double required
Example:1
aboveTypestring required

Supported values : STOP_LOSS_LIMIT, STOP_LOSS, LIMIT_MAKER

aboveClientOrderIdstring

Arbitrary unique ID among open orders for the above order. Automatically generated if not sent

aboveIcebergQtynumber double

Note that this can only be used if aboveTimeInForce is GTC.

abovePricenumber double
aboveStopPricenumber double

Can be used if aboveType is STOP_LOSS or STOP_LOSS_LIMIT. Either aboveStopPrice or aboveTrailingDelta or both, must be specified.

aboveTrailingDeltanumber double
aboveTimeInForce'GTC' | 'IOC' | 'FOK'
Example:GTC

Required if the aboveType is STOP_LOSS_LIMIT.

aboveStrategyIdnumber double

Arbitrary numeric value identifying the above order within an order strategy.

aboveStrategyTypeinteger

Arbitrary numeric value identifying the above order strategy. Values smaller than 1000000 are reserved and cannot be used.

belowTypestring required

Supported values : STOP_LOSS_LIMIT, STOP_LOSS, LIMIT_MAKER

belowClientOrderIdstring

Arbitrary unique ID among open orders for the below order. Automatically generated if not sent

belowIcebergQtynumber double

Note that this can only be used if belowTimeInForce is GTC.

belowPricenumber double

Can be used if belowType is STOP_LOSS_LIMIT or LIMIT_MAKER to specify the limit price.

belowStopPricenumber double

Can be used if belowType is STOP_LOSS or STOP_LOSS_LIMIT. Either belowStopPrice or belowTrailingDelta or both, must be specified.

belowTrailingDeltanumber double
belowTimeInForce'GTC' | 'IOC' | 'FOK'
Example:GTC

Required if the belowType is STOP_LOSS_LIMIT.

belowStrategyIdnumber double

Arbitrary numeric value identifying the below order within an order strategy.

belowStrategyTypeinteger

Arbitrary numeric value identifying the below order strategy. Values smaller than 1000000 are reserved and cannot be used.

newOrderRespType'ACK' | 'RESULT' | 'FULL'

Set the response JSON. MARKET and LIMIT order types default to FULL, all other orders default to ACK.

selfTradePreventionMode'EXPIRE_TAKER' | 'EXPIRE_MAKER' | 'EXPIRE_BOTH' | 'NONE'
Example:EXPIRE_TAKER

The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.

recvWindowinteger
Example:5000

The value cannot be greater than 60000

timestampinteger required

UTC timestamp in ms

signaturestring required

Signature

Response

New OCO details

orderListIdinteger required
contingencyTypestring required
listStatusTypestring required
listOrderStatusstring required
listClientOrderIdstring required
transactionTimeinteger required
symbolstring required

Example response

{
  "orderListId": 1,
  "contingencyType": "OCO",
  "listStatusType": "EXEC_STARTED",
  "listOrderStatus": "EXECUTING",
  "listClientOrderId": "lH1YDkuQKWiXVXHPSKYEIp",
  "transactionTime": 1710485608839,
  "symbol": "LTCBTC",
  "orderReports": [
    {
      "symbol": "LTCBTC",
      "orderId": 10,
      "orderListId": 1,
      "clientOrderId": "44nZvqpemY7sVYgPYbvPih",
      "transactTime": 1710485608839,
      "price": "1.000000",
      "origQty": "5.00000000",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "STOP_LOSS_LIMIT",
      "side": "SELL",
      "stopPrice": "1.00000000",
      "workingTime": -1,
      "icebergQty": "1.00000000",
      "selfTradePreventionMode": "NONE"
    },
    {
      "symbol": "LTCBTC",
      "orderId": 11,
      "orderListId": 1,
      "clientOrderId": "NuMp0nVYnciDiFmVqfpBqK",
      "transactTime": 1710485608839,
      "price": "3.00000000",
      "origQty": "5.00000000",
      "executedQty": "0.000000",
      "cummulativeQuoteQty": "0.000000",
      "status": "NEW",
      "timeInForce": "GTC",
      "type": "LIMIT_MAKER",
      "side": "SELL",
      "workingTime": 1710485608839,
      "selfTradePreventionMode": "NONE"
    }
  ]
}