Skip to main content

Place TP/SL Order by Position

Response Example

{
"success": false,
"code": 0,
"message": "",
"data": [
{
"id": 0,
"symbol": "",
"leverage": 0,
"side": 0,
"triggerPrice": 0.0,
"price": 0.0,
"vol": 0.0,
"openType": 0,
"triggerType": 0,
"state": 0,
"executeCycle": 0,
"trend": 0,
"orderType": 0,
"orderId": 0,
"errorCode": 0,
"createTime": "",
"updateTime": ""
}
]
}
  • POST /api/v1/private/stoporder/place

Required Permission: Order Placing

Request Parameters:

ParameterTypeRequiredDescription
lossTrendinttrueStop-loss type: 1 latest price 2 fair price 3 index price
profitTrendinttrueTake-profit type: 1 latest price 2 fair price 3 index price
positionIdlongtruePosition id
voldecimaltrueOrder quantity; must be within the allowed range for the contract; the order quantity plus existing TP/SL order quantity must be less than the closable quantity; position quantity will not be frozen, but checks are required
stopLossPricedecimalfalseStop-loss price; at least one of stop-loss or take-profit must be non-empty and greater than 0
takeProfitPricedecimalfalseTake-profit price; at least one of stop-loss or take-profit must be non-empty and greater than 0
priceProtectintfalseTrigger protection: "1","0"
profitLossVolTypestringfalseTP/SL quantity type (SAME: same quantity; SEPARATE: different quantities)
takeProfitVoldecimalfalseTake-profit quantity (when profitLossVolType == SEPARATE)
stopLossVoldecimalfalseStop-loss quantity (when profitLossVolType == SEPARATE)
volTypeintfalseQuantity type 1: partial TP/SL 2: position TP/SL
takeProfitReverseintfalseTake-profit reverse: 1 yes 2 no
stopLossReverseintfalseStop-loss reverse: 1 yes 2 no
mtokenstringfalseWeb device id
takeProfitTypeintfalseTake-profit type 0 - market TP 1 - limit TP
takeProfitOrderPricedecimaltrueLimit TP order price
stopLossTypelongtrueStop-loss type 0 - market SL 1 - limit SL
stopLossOrderPricedecimaltrueLimit SL order price

Response Parameters:

On success, success = true, data is the order id; on failure, success = false, data = null. If there is a non-final TP/SL order with the same price, the previous id is returned and the previous order quantity is updated asynchronously.