Strategy Trading
Strategy Trading
Place Strategy Order
Place a strategy order
API Broker rebate identifier:
The following code block needs to be added to the HTTP Header of the request.
"X-CHANNEL-API-CODE":"your-channel-api-code"
- Speed limit is 10 times/s (UID)
- Permission: UTA trade (read & write)
Place Strategy Order › Request Parameters
categoryProduct type
SPOT Spot
MARGIN Margin
USDT-FUTURES USDT futures
COIN-FUTURES Coin-M futures
USDC-FUTURES USDC futures
symbolSymbol name
e.g.,BTCUSDT
typeStrategy Type
tpsl Take-Profit and Stop-Loss
trigger Trigger Order
oco One-Cancels-the-Other Order
trailing_stop Trailing Stop Order
iceberg Iceberg Order
twap TWAP Order
Default:tpsl
sideTrade side
buy/sell
Hedge-mode:
Open long: side=buy & posSide=long
Open short: side=sell & posSide=short
Close long: side=sell & posSide=long
Close short: side=buy & posSide=short
One-way mode:
Open long: side=buy
Open short: side=sell
Close long: side=sell & reduceOnly=yes
Close short: side=buy & reduceOnly=yes
posSidePosition side
long/short
qtyOrder Quantity
clientOidClient order ID
The idempotent validity period is six hours (not fully guaranteed)
Only valid when type=tpsl; not supported for other strategy types
Decision Table
| Variant | Matching Criteria |
|---|---|
| type = object | |
| type = object | |
| type = object · requires: ocoParams | |
| type = object · requires: trailingStopParams | |
| type = object · requires: icebergParams | |
| type = object · requires: twapParams |
tpslModeTake-Profit and Stop-Loss Mode
fullAll Positions Take-Profit and Stop-Loss
partialPartial Position Take-Profit and Stop-Loss
If left blank, the default value is full
qtyOrder Quantity
Required when tpslMode=partial. Unit is in the base coin
reduceOnlyWhether it is reduce-only
yes/no
tpTriggerByTake-Profit Trigger Type
market: Market Price
mark: Mark Price
If not specified, the default value is market price
slTriggerByStop-Loss Trigger Type
market: Market Price
mark: Mark Price
If not filled in, the default value is market price
takeProfitTake-Profit Trigger Price
stopLossStop-Loss Trigger Price
tpOrderTypeTake-Profit Trigger Strategy Order Type
limit: Limit Order
market: Market Order
If not filled in, the default value is market price
slOrderTypeStop-Loss Trigger Strategy Order Type
limit: Limit Order
market: Market Order
If not filled in, the default value is market price
tpLimitPriceTake-Profit Strategy Order Execution Price
This field is only valid for limit orders (when tpOrderType=limit); it is ignored for market orders.
slLimitPriceStop-Loss Strategy Order Execution Price
This field is only valid for limit orders (when slOrderType=limit); it is ignored for market orders
Place Strategy Order › Response Parameters
Successful response
codemsgrequestTimeorderIdOrder ID
clientOidClient order ID
Modify Strategy Order
Modify strategy order
- Speed limit is 10 times/s (UID)
- Permission: UTA trade (read & write)
Modify Strategy Order › Request Parameters
orderIdOrder ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority
qtyOrder Quantity
Can be modified under partial take-profit/stop-loss mode, and the unit is in the base coin
clientOidClient order ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority
tpTriggerByTake-Profit Trigger Type
market: Market Price
mark: Mark Price
slTriggerByStop-Loss Trigger Type
market: Market Price
mark: Mark Price
takeProfitTake-Profit Trigger Price
stopLossStop-Loss Trigger Price
tpOrderTypeTake-Profit Trigger Strategy Order Type
limit: Limit Order
market: Market Order
slOrderTypeStop-Loss Trigger Strategy Order Type
limit: Limit Order
market: Market Order
tpLimitPriceTake-Profit Strategy Order Execution Price
This field is only valid for limit orders (when tpOrderType=limit); it is ignored for market orders.
slLimitPriceStop-Loss Strategy Order Execution Price
This field is only valid for limit orders (when slOrderType=limit); it is ignored for market orders
triggerByTrigger order trigger price type
market: Market Price
mark: Mark Price
triggerPriceTrigger order trigger price
Only valid for limit orders (when triggerOrderType=limit)
triggerOrderTypeTrigger order type
limit: Limit Order
market: Market Order
triggerOrderPriceTrigger order execution price
Only valid for limit orders (when triggerOrderType=limit)
Modify Strategy Order › Response Parameters
Successful response
codemsgrequestTimeorderIdOrder ID
clientOidClient order ID
Cancel Strategy Order
Cancel strategy order
For iceberg/twap orders, cancelling the parent order also cancels all of its unfilled child orders. For oco orders, cancelling either leg of the pair also cancels the other leg.
- Speed limit is 10 times/s (UID)
- Permission: UTA trade (read & write)
Cancel Strategy Order › Request Parameters
orderIdOrder ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority
clientOidClient order ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority
Cancel Strategy Order › Response Parameters
Successful response
codemsgrequestTimecodeCode
msgMsg
requestTimeTimestamp
Unfilled Strategy Orders
Get unfilled strategy orders
- Speed limit is 20 times/s (UID)
- Permission: UTA trade (read)
Request Parameters
categoryProduct type
SPOT Spot
MARGIN Margin
USDT-FUTURES USDT futures
COIN-FUTURES Coin-M futures
USDC-FUTURES USDC futures
typeStrategy Type
tpsl Take-Profit and Stop-Loss
trigger Trigger Order
oco OCO
trailing_stop Trailing Stop
iceberg Iceberg
twap TWAP
Unfilled Strategy Orders › Response Parameters
Successful response
codemsgrequestTimeOrder list
orderIdOrder ID
clientOidClient order ID
categoryProduct type
USDT-FUTURES USDT futures
COIN-FUTURES Coin-M futures
USDC-FUTURES USDC futures
symbolSymbol name
e.g.,BTCUSDT
qtyOrder Quantity
posSidePosition side
long/short
statusStrategy order status
pending Waiting to be executed
success Executed
failed Execution failed
cancelled Cancelled
submitting Submitting
tpTriggerByTake-Profit Trigger Type
market: Market Price
mark: Mark Price
slTriggerByStop-Loss Trigger Type
market: Market Price
mark: Mark Price
takeProfitTake-Profit Trigger Price
stopLossStop-Loss Trigger Price
tpOrderTypeTake-Profit Trigger Strategy Order Type
limit: Limit Order
market: Market Order
slOrderTypeStop-Loss Trigger Strategy Order Type
limit: Limit Order
market: Market Order
tpLimitPriceTake-Profit Strategy Order Execution Price
slLimitPriceStop-Loss Strategy Order Execution Price
triggerByTrigger order trigger price type
market: Market Price
mark: Mark Price
triggerPriceTrigger order trigger price
triggerOrderTypeTrigger order type
limit: Limit Order
market: Market Order
triggerOrderPriceTrigger order execution price
OCO parameters list
Returned when type=oco
Trailing stop parameters list
Returned when type=trailing_stop
Iceberg parameters list
Returned when type=iceberg
TWAP parameters list
Returned when type=twap
createdTimeOrder created timestamp A Unix millisecond timestamp
updatedTimeOrder update timestamp A Unix millisecond timestamp
History Strategy Orders
Get historical strategy orders
- Speed limit is 20 times/s (UID)
- Permission: UTA trade (read)
Request Parameters
categoryProduct type
SPOT Spot
MARGIN Margin
USDT-FUTURES USDT futures
COIN-FUTURES Coin-M futures
USDC-FUTURES USDC futures
typeStrategy Type
tpsl Take-Profit and Stop-Loss
trigger Trigger Order
oco OCO
trailing_stop Trailing Stop
iceberg Iceberg
twap TWAP
startTimeStart timestamp
A Unix timestamp in milliseconds e.g.,1597026383085
endTimeEnd timestamp
A Unix timestamp in milliseconds e.g.,1597026383085
limitLimit per page
Default:100. Maximum:100
cursorCursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages
History Strategy Orders › Response Parameters
Successful response
codemsgrequestTimeOrder list
cursorCursor for next page
Pass this value as the cursor parameter in the next request to get the next page of data
Get Strategy Sub-orders
Get historical sub-orders generated by a strategy order
- Rate limit: 10 times/s (UID)
- Permission: UTA trade (read)
Request Parameters
orderIdStrategy order ID
limitLimit per page
Default:100. Maximum:100
cursorCursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages
Get Strategy Sub-orders › Response Parameters
Successful response
codemsgrequestTimeSub-order list
cursorCursor for next page
Pass this value as the cursor parameter in the next request to get the next page of data
