Skip to main content

Set TP/SL Mode

tip

To some extent, this endpoint is depreciated because now tpsl is based on order level. This API was used for position level change before.

However, you still can use it to set an implicit tpsl mode for a certain symbol because when you don't pass "tpslMode" in the place order or trading stop request, system will get the tpslMode by the default setting.

Set TP/SL mode to Full or Partial

Unified account covers: USDT perpetual / Inverse contract
Classic account covers: USDT perpetual / Inverse contract

info

For partial TP/SL mode, you can set the TP/SL size smaller than position size.

HTTP Request

POST /v5/position/set-tpsl-mode

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • Unified account: linear, inverse
  • Classic account: linear, inverse. Please note that category is not involved with business logic
symboltruestringSymbol name
tpSlModetruestringTP/SL mode. Full,Partial

Response Parameters

ParameterTypeComments
tpSlModestringFull,Partial

Request Example

POST /v5/position/set-tpsl-mode HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672279325035
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"symbol": "XRPUSDT",
"category": "linear",
"tpSlMode": "Full"
}

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"tpSlMode": "Full"
},
"retExtInfo": {},
"time": 1672279322666
}