Place Algo Order

Rate Limit: 3 requests per 10 seconds

Place a new algo order, this api is asynchronous. Returning success only means that the request is successful. The final result needs to be confirmed through websocket subscription and order query.

Request

Field nameTypeNecessaryRemarks
clientOrderIdStringNCustomer defined order ID ,only support letters(a-z) and numbers(0-9)
algoOrderType StringYAlgo order types: only TPSL. ATTACHED_TPSL has been moved to normal orders endpoint.
symStringYSym(unique identifier:Exchange_Business_Base_Counter.
Example:
If you want to place a SPOT order for the BTC/USDT trading pair on the Binance exchange, you can use a unique identifier like this: "BINANCE_SPOT_BTC_USDT" ;
If you want to place a PERPETUAL order for the BTC/USDT trading pair on the Binance exchange, you can use a unique identifier like this: "BINANCE_PERP_BTC_USDT" ;
)

Note that we currently only support the SPOT and PERPETUAL trade of Binance and OKX.
sideStringNSide(BUY, SELL)
limitPriceStringNLimit order price(Mandatory for limit order)
orderQtyStringNOrder quantity(Mandatory, unless spot market buy ) note: trading unit of OKX is the number of contracts/ trading unit of Binance is the number of coin
positionSideStringNPosition side, NONE/LONG/SHORT, default NONE. NONE stands for one-way mode.
reduceOnlyStringNReduce position orders only, must "true" or "false"

TP/SL:only support PERP syms.

Field nameTypeNecessaryRemarks
conditionTypeStringY CONDITIONAL / OCO / ENTIRE_CLOSE_POSITION / PARTIAL_CLOSE_POSITION
conditionalTriggerPriceStringN Trigger Price for CONDITIONAL order
conditionalTriggerTypeStringNTrigger Price Type for CONDITIONAL order. LAST_PRICE / MARK_PRICE
conditionalPriceStringNLimit Price for CONDITIONAL order ;
0 Indicates Market Price
tpTriggerPriceStringNTake-profit trigger price.
tpTriggerTypeStringNTake-profit trigger price type:
LAST_PRICE, MARK_PRICE
The default is LAST_PRICE
tpPriceStringNTake-profit order price;
If the price is 0, take-profit will be executed at the market price.
slTriggerPriceStringNStop-loss trigger price
slTriggerTypeStringNStop-loss trigger price type:
LAST_PRICE, MARK_PRICE
The default is LAST_PRICE
slPriceStringNStop-loss order price;
If the price is 0, stop-loss will be executed at the market price.

💡

Tips:We recommend using ENTIRE_CLOSE_POSITION or PARTIAL_CLOSE_POSITION order types when setting Take-Profit and Stop-Loss (TPSL) for closing positions.

1.Simultaneous Placement: Both order types support placing Stop-Loss (SL) and Take-Profit (TP) orders at the same time.
2.ENTIRE_CLOSE_POSITION: When either the TP or SL side is triggered, the entire position will be closed. Once the position is closed, the corresponding TP/SL order is completed, and no residual orders will remain.
3.PARTIAL_CLOSE_POSITION: While a position is active, if one side (TP or SL) is triggered, the other side will not be automatically cancelled. However, if the position reaches 0, the system will then automatically cancel the remaining TP/SL orders.
4.Reduce-Only Attribute: Both ENTIRE_CLOSE_POSITION and PARTIAL_CLOSE_POSITION orders come with a reduceOnly attribute. These are designed strictly for closing positions and will not open any new positions.


Response

Field nameTypeRemarks
algoOrderIdStringAlgo order ID
clientOrderIdStringCustomer defined order ID
Responses

Language
LoadingLoading…
Response
Choose an example:
application/json