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
| Field | Type | Required | Description |
|---|---|---|---|
category | string | Yes | Product type linear |
symbol | string | Yes | Trading pair |
positionIdx | int64 | No | Position direction: 0 indicates single-direction holding, 1 indicates long-side bi-directional holding, 2 indicates short-side bi-directional holding. Must match actual position. |
takeProfit | string | No | take-profit trigger price. Send "0" to cancel |
stopLoss | string | No | stop-loss trigger price. Send "0" to cancel |
tpTriggerBy | string | No | Take-profit trigger price type. Futures support LastPrice/MarkPrice by default; LastPrice is default. |
slTriggerBy | string | No | Stop-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
}