Skip to main content

Margin Account New OCO (TRADE)

API Description

Send in a new OCO for a margin account

HTTP Request

POST /sapi/v1/margin/order/oco

Request Weight

6(UID)

Request Parameters

NameTypeMandatoryDescription
symbolSTRINGYES
isIsolatedSTRINGNOfor isolated margin or not, "TRUE", "FALSE",default "FALSE"
listClientOrderIdSTRINGNOA unique Id for the entire orderList
sideENUMYES
quantityDECIMALYES
limitClientOrderIdSTRINGNOA unique Id for the limit order
priceDECIMALYES
limitIcebergQtyDECIMALNO
stopClientOrderIdSTRINGNOA unique Id for the stop loss/stop loss limit leg
stopPriceDECIMALYES
stopLimitPriceDECIMALNOIf provided, stopLimitTimeInForce is required.
stopIcebergQtyDECIMALNO
stopLimitTimeInForceENUMNOValid values are GTC/FOK/IOC
newOrderRespTypeENUMNOSet the response JSON.
sideEffectTypeENUMNONO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY,AUTO_BORROW_REPAY; default NO_SIDE_EFFECT. More info in FAQ
selfTradePreventionModeENUMNOThe allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE
autoRepayAtCancelBOOLEANNOOnly when MARGIN_BUY or AUTO_BORROW_REPAY order takes effect, true means that the debt generated by the order needs to be repay after the order is cancelled. The default is true
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES
  • autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution

Response Example

{
"orderListId": 0,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp",
"transactionTime": 1563417480525,
"symbol": "LTCBTC",
"marginBuyBorrowAmount": "5", // will not return if no margin trade happens
"marginBuyBorrowAsset": "BTC", // will not return if no margin trade happens
"isIsolated": false, // if isolated margin
"orders": [
{
"symbol": "LTCBTC",
"orderId": 2,
"clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos"
},
{
"symbol": "LTCBTC",
"orderId": 3,
"clientOrderId": "xTXKaGYd4bluPVp78IVRvl"
}
],
"orderReports": [
{
"symbol": "LTCBTC",
"orderId": 2,
"orderListId": 0,
"clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
"transactTime": 1563417480525,
"price": "0.000000",
"origQty": "0.624363",
"executedQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "STOP_LOSS",
"side": "BUY",
"stopPrice": "0.960664",
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBTC",
"orderId": 3,
"orderListId": 0,
"clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
"transactTime": 1563417480525,
"price": "0.036435",
"origQty": "0.624363",
"executedQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "BUY",
"selfTradePreventionMode": "NONE"
}
]
}