Skip to main content

Set Position Take Profit and Stop Loss

Description​

Set take-profit and stop-loss for position

HTTP Request​

  • POST /api/v3/position/trading-stop
  • Supported Products: linear
  • Rate Limit: 10 requests per second per UID

Request Parameters​

FieldTypeRequiredDescription
categorystringYesProduct type linear
symbolstringYesTrading pair
positionIdxint64NoPosition direction: 0 indicates single-direction holding, 1 indicates long-side bi-directional holding, 2 indicates short-side bi-directional holding. Must match actual position.
takeProfitstringNotake-profit trigger price. Send "0" to cancel
stopLossstringNostop-loss trigger price. Send "0" to cancel
tpTriggerBystringNoTake-profit trigger price type. Futures support LastPrice/MarkPrice by default; LastPrice is default.
slTriggerBystringNoStop-loss trigger price type. Futures support LastPrice/MarkPrice by default; LastPrice is default.

Response Parameters​

No business fields. Returns code: 200 in the standard format upon success, as shown below.

Request Example​

POST /api/v3/position/trading-stop HTTP/1.1
Host: openapi.lbank.com
Content-Type: application/json
ex-api-key: <your_api_key>
ex-timestamp: <current_unix_timestamp_ns>
ex-nonce: <unique_random_hex>
ex-signature: <your_signature>
ex-client-type: API

{
"category": "linear",
"symbol": "BTCUSDT",
"positionIdx": 0,
"takeProfit": "65000",
"stopLoss": "55000",
"tpTriggerBy": "MarkPrice",
"slTriggerBy": "MarkPrice"
}

Response Example​

HTTP/1.1 200 OK
Content-Type: application/json

{
"code": 200,
"message": "Success",
"data": {},
"extras": null
}