Get Trailing SL/TP Information
API Description
This interface allows querying trailing stop loss and take profit details for futures trading.
Note: Trailing SL/TP information is only available via RESTful API.
Precautions
None
Authentication
This is a private interface and requires authentication. For details on using the RESTful API, refer to Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface.
Request Method
GET
Endpoint
Frequency Limit
The frequency limit for this interface is 5 requests/s per user ID and IP. In addition to this per-interface limit, a global rate limit is also enforced.
For detailed information on Global rate limits and API Rate Limiting Policy, please refer to the "Frequency Limit" section at click here
Request Parameters
This interface does not require any request parameters.
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| baseSize | BigDecimal | Order size in contract |
| callbackRate | BigDecimal | Callback rate |
| createdDate | Long | Order creation timestamp |
| currentPiece | BigDecimal | Current number of contracts |
| direction | String | Trade direction: long/short |
| fee | BigDecimal | Handling fees |
| instrument | String | Base currency of the instrument e.g., BTC or ETH. |
| leverage | BigDecimal | Position leverage |
| margin | BigDecimal | Margin used by the position |
| openId | Long | Position ID |
| openPrice | BigDecimal | Opening price at which the order was filled |
| orderPrice | BigDecimal | Order price specified |
| originalType | String | Original order type |
| posType | String | Position type: plan/planTrigger/execute/moveStopProfitLoss |
| positionModel | Integer | Position margin mode: 0: Isolated margin 1: Cross margin |
| positionMargin | BigDecimal | Position margin |
| quantity | BigDecimal | Specifies order size based on quantityUnit: If quantityUnit=0, the quantity is measured the quote currency (e.g., USDT in BTC-USDT), If quantityUnit=1, the quantity is measured in number of contracts, If quantityUnit=2, the quantity is measured in the base currency (e.g., BTC in BTC-USDT) |
| quantityUnit | Integer | Specifies the unit for order size: 0: Denominated in the quote currency (e.g., USDT in BTC-USDT), 1: Denominated in number of contracts, 2: Denominated in the base currency (e.g., BTC in BTC-USDT) |
| status | String | Status: open, close |
| triggerPrice | BigDecimal | Trigger price for a perpetual contract plan order |
| triggerType | String | Specifies order type once triggerPrice is met: 0: Limit order 1: Market order |
| updatedDate | Long | Timestamp of the last update. |
| contractType | Integer | Contract Type: 1: Linear perpetuals |
| finishStatus | Integer | Finish status |
| fundingFee | String | Funding fee |
| id | Long | ID (user can ignore it) |
| processStatus | Integer | Match server processing status: 0: Waiting 1: Processing 2: Success 3: Failure |
| source | String | Source: web/api |
| status | String | Order status: open/close/cancel |
| userId | Integer | Contract account User ID |
| version | Integer | (user can ignore it) |
Request Example
The following Python code shows how to get the trailing stop loss and take profit information.
Note: For a complete code example, please refer to Introduction > Authentication & Code Snippet > Futures > Restful Private Interface.
params = {}
api_url = "/v1/perpum/moveTPSL"
method = "GET"
response_code, response_data = FuturesRestfulPrivate(params, api_url, method, sec_key, api_key) # function FuturesRestfulPrivate() is defined in section (Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface)
Note: For a complete Java code example, please refer to Introduction > Authentication & Code Snippet > Futures > RESTful Private Interface.
Response Example
The following is an example response returned by the above Python request:
{'code': 0,
'data': [{'baseSize': 0.001,
'callbackRate': 0.5,
'contractType': 1,
'createdDate': 1740901653000,
'currentPiece': 1,
'direction': 'long',
'fee': '0',
'finishStatus': 1,
'fundingFee': '0',
'id': '650302470008901',
'instrument': 'BTC',
'leverage': 2,
'margin': 43.1233,
'openId': '2435521222632107649',
'openPrice': 86246.6,
'orderPrice': 0,
'originalType': 'moveStopProfitLoss',
'posType': 'moveStopProfitLoss',
'positionMargin': 43.1233,
'positionModel': 0,
'processStatus': 0,
'quantity': 1,
'quantityUnit': 1,
'source': 'api',
'status': 'close',
'triggerPrice': 0,
'triggerType': 1,
'updatedDate': 1740901653000,
'userId': 1162061,
'version': 0}],
'msg': ''}