跳到主要内容

为仓位绑定止盈 / 止损

为现有仓位附加止盈和/或止损触发订单;takeProfitTriggerPrice 或 stopLossTriggerPrice 至少需提供一个。

请求参数

名称类型是否必填描述
symbolString要附加止盈/止损的仓位所属市场交易对(例如 BTC-PERP)。
orderSideString平仓触发订单的方向;与仓位方向相反(多头为 SELL,空头为 BUY)。
positionModeString目标仓位的仓位模式(ONE_WAY 或 HEDGE)。对冲模式下必填以消除歧义。
positionIdString要附加止盈/止损的仓位标识符。
takeProfitTriggerTypeString用于评估止盈触发的参考价格类型(INDEX_PRICE、LAST_PRICE 或 MARK_PRICE)。
takeProfitTriggerPriceDouble止盈触发价格。若未提供 stopLossTriggerPrice 则必填。
stopLossTriggerTypeString用于评估止损触发的参考价格类型(INDEX_PRICE、LAST_PRICE 或 MARK_PRICE)。
stopLossTriggerPriceDouble止损触发价格。若未提供 takeProfitTriggerPrice 则必填。

响应内容

名称类型描述
symbolString仓位所属市场交易对(例如 BTC-PERP)。
statusInteger止盈/止损绑定的状态码。
typeInteger止盈/止损响应条目的事件类型代码(指示其代表止盈还是止损)。
orderIdString所创建触发订单的服务器分配标识符。
clOrderIdString客户端分配的订单 ID(如请求中提供)。
triggerPriceDouble止盈或止损触发时的触发价格。
positionModeString目标仓位的仓位模式(ONE_WAY 或 HEDGE)。
positionDirectionString目标仓位的仓位方向(LONG 或 SHORT)。
positionIdString触发订单所附加仓位的标识符。
timestampLong响应的服务器时间戳,单位为自 epoch 起的毫秒数。
messageString描述结果的可读消息。
example
POSThttps://api.btse.com/futures/api/v3/trade/positions/tpsl

Request (default)

{
"symbol": "BTC-PERP",
"orderSide": "SELL",
"positionId": "BTC-PERP-USDT",
"takeProfitTriggerType": "MARK_PRICE",
"takeProfitTriggerPrice": 63010.5,
"stopLossTriggerType": "MARK_PRICE",
"stopLossTriggerPrice": 57009.5
}

Response (default)

[
{
"symbol": "BTC-PERP",
"status": 9,
"type": 0,
"orderId": "bf02a69f-d735-437c-bc59-4759dc850c2b",
"clOrderId": "",
"triggerPrice": 0,
"positionMode": "ONE_WAY",
"positionDirection": null,
"positionId": "BTC-PERP-USDT",
"timestamp": 1784882344606,
"message": null
}
]