Skip to main content

Bind take-profit / stop-loss to a position

Attaches a take-profit and/or stop-loss trigger order to an existing position; at least one of takeProfitTriggerPrice or stopLossTriggerPrice must be provided.

Request Parameters​

NameTypeRequiredDescription
symbolStringYesMarket symbol of the position to attach TP/SL to (e.g. BTC-PERP).
orderSideStringYesSide of the closing trigger order; the opposite of the position direction (SELL for LONG, BUY for SHORT).
positionModeStringNoPosition mode of the target position (ONE_WAY or HEDGE). Required in hedge mode to disambiguate.
positionIdStringYesIdentifier of the position to attach TP/SL to.
takeProfitTriggerTypeStringNoReference price type used to evaluate the take-profit trigger (INDEX_PRICE, LAST_PRICE, or MARK_PRICE).
takeProfitTriggerPriceDoubleNoTake-profit trigger price. Required if stopLossTriggerPrice is not provided.
stopLossTriggerTypeStringNoReference price type used to evaluate the stop-loss trigger (INDEX_PRICE, LAST_PRICE, or MARK_PRICE).
stopLossTriggerPriceDoubleNoStop-loss trigger price. Required if takeProfitTriggerPrice is not provided.

Response Content​

NameTypeDescription
symbolStringMarket symbol of the position (e.g. BTC-PERP).
statusIntegerStatus code of the TP/SL binding.
typeIntegerEvent type code of the TP/SL response entry (indicates whether it represents take-profit or stop-loss).
orderIdStringServer-assigned identifier of the created trigger order.
clOrderIdStringClient-assigned order id, if provided in the request.
triggerPriceDoubleTrigger price at which the take-profit or stop-loss will fire.
positionModeStringPosition mode of the target position (ONE_WAY or HEDGE).
positionDirectionStringPosition direction of the target position (LONG or SHORT).
positionIdStringIdentifier of the position the trigger is attached to.
timestampLongServer timestamp of the response, in milliseconds since epoch.
messageStringHuman-readable message describing the result.
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
}
]