Skip to main content

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

/v1/perpum/moveTPSL

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

ParameterTypeDescription
baseSizeBigDecimalOrder size in contract
callbackRateBigDecimalCallback rate
createdDateLongOrder creation timestamp
currentPieceBigDecimalCurrent number of contracts
directionStringTrade direction: long/short
feeBigDecimalHandling fees
instrumentStringBase currency of the instrument e.g., BTC or ETH.
leverageBigDecimalPosition leverage
marginBigDecimalMargin used by the position
openIdLongPosition ID
openPriceBigDecimalOpening price at which the order was filled
orderPriceBigDecimalOrder price specified
originalTypeStringOriginal order type
posTypeStringPosition type:
plan/planTrigger/execute/moveStopProfitLoss
positionModelIntegerPosition margin mode:
0: Isolated margin
1: Cross margin
positionMarginBigDecimalPosition margin
quantityBigDecimalSpecifies 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)
quantityUnitIntegerSpecifies 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)
statusStringStatus: open, close
triggerPriceBigDecimalTrigger price for a perpetual contract plan order
triggerTypeStringSpecifies order type once triggerPrice is met:
0: Limit order
1: Market order
updatedDateLongTimestamp of the last update.
contractTypeIntegerContract Type:
1: Linear perpetuals
finishStatusIntegerFinish status
fundingFeeStringFunding fee
idLongID (user can ignore it)
processStatusIntegerMatch server processing status:
0: Waiting
1: Processing
2: Success
3: Failure
sourceStringSource: web/api
statusStringOrder status: open/close/cancel
userIdIntegerContract account User ID
versionInteger(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': ''}