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
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
isIsolated | STRING | NO | for isolated margin or not, "TRUE", "FALSE",default "FALSE" |
listClientOrderId | STRING | NO | A unique Id for the entire orderList |
side | ENUM | YES | |
quantity | DECIMAL | YES | |
limitClientOrderId | STRING | NO | A unique Id for the limit order |
price | DECIMAL | YES | |
limitIcebergQty | DECIMAL | NO | |
stopClientOrderId | STRING | NO | A unique Id for the stop loss/stop loss limit leg |
stopPrice | DECIMAL | YES | |
stopLimitPrice | DECIMAL | NO | If provided, stopLimitTimeInForce is required. |
stopIcebergQty | DECIMAL | NO | |
stopLimitTimeInForce | ENUM | NO | Valid values are GTC /FOK /IOC |
newOrderRespType | ENUM | NO | Set the response JSON. |
sideEffectType | ENUM | NO | NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY,AUTO_BORROW_REPAY; default NO_SIDE_EFFECT. More info in FAQ |
selfTradePreventionMode | ENUM | NO | The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE |
autoRepayAtCancel | BOOLEAN | NO | Only 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 |
recvWindow | LONG | NO | The value cannot be greater than 60000 |
timestamp | LONG | YES |
- 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"
}
]
}