跳到主要内容

杠杆账户 OCO 下单(TRADE)

接口描述

杠杆账户发送新 OCO 订单。

HTTP请求

POST /sapi/v1/margin/order/oco

请求权重

6(UID)

请求参数

名称类型是否必需描述
symbolSTRINGYES
isIsolatedSTRINGNO是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
listClientOrderIdSTRINGNO整个orderList的唯一ID
sideENUMYES详见枚举定义:订单方向
quantityDECIMALYES
limitClientOrderIdSTRINGNO限价单的唯一ID
priceDECIMALYES
limitIcebergQtyDECIMALNO
stopClientOrderIdSTRINGNO止损/止损限价单的唯一ID
stopPriceDECIMALYES
stopLimitPriceDECIMALNO如果提供,须配合提交stopLimitTimeInForce
stopIcebergQtyDECIMALNO
stopLimitTimeInForceENUMNO有效值 GTC/FOK/IOC
newOrderRespTypeENUMNO详见枚举定义:订单返回类型
sideEffectTypeENUMNONO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY,AUTO_BORROW_REPAY; 默认为 NO_SIDE_EFFECT;详见FAQ
selfTradePreventionModeENUMNO允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKER,EXPIRE_MAKER,EXPIRE_BOTH,NONE
autoRepayAtCancelBOOLEANNO只有在自动借款单或者自动借还单生效,true表示的是撤单后需要把订单产生的借款归还,默认为true
recvWindowLONGNO不能大于 60000
timestampLONGYES
  • autoRepayAtCancel 补充说明: 在频繁下单撤单的情况下,为提高资金利用率,建议设置为FALSE

其他信息:

  • 价格限制:
    • SELL: 限价 > 最新成交价 >触发价
    • BUY: 限价 < 最新成交价 < 触发价
  • 数量限制:
    • 两个 legs 必须具有同样的数量。
    • ICEBERG数量不必相同
  • 下单rate
    • 一个OCO订单被算成2个普通订单.

响应示例

{
"orderListId": 0,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp",
"transactionTime": 1563417480525,
"symbol": "LTCBTC",
"marginBuyBorrowAmount": "5", // 下单后没有发生借款则不返回该字段
"marginBuyBorrowAsset": "BTC", // 下单后没有发生借款则不返回该字段
"isIsolated": false, // 是否是逐仓symbol交易
"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"
}
]
}