binance_place_oto_order
Place a Binance one-triggers-the-other (OTO) order pair: submits the first order immediately and places the second only after the first fully fills.
Instructions
Place a REAL one-triggers-the-other pair (entry, then follow-up). Real money.
Calls POST /api/v3/orderList/oto (SIGNED, IP weight 1, unfilled-order count 2). The
working leg (LIMIT or LIMIT_MAKER) goes on the book immediately. The pending
leg is only placed once the working leg is fully filled — until then it sits in
PENDING_NEW and does nothing. Cancelling either leg kills the whole list.
Kill-switch. Refused with Error: … trading is disabled … unless the server runs
with BINANCE_ALLOW_TRADING=1.
There is no dry-run for a list; binance_test_order validates one order at a time.
Mandatory extras, enforced locally (S2 L3419):
working_type=LIMIT→working_time_in_force;pending_type=LIMIT→pending_price,pending_time_in_force;pending_type=STOP_LOSS|TAKE_PROFIT→pending_stop_priceand/orpending_trailing_delta;pending_type=STOP_LOSS_LIMIT|TAKE_PROFIT_LIMIT→pending_price,pending_time_in_force, andpending_stop_priceand/orpending_trailing_delta;pending_type=LIMIT_MAKER→pending_price. A MARKET pending leg is allowed, but only bypending_quantity— Binance does not supportquoteOrderQtyinside a list, and this server never sends it.
When to Use:
Entry plus a single exit: buy at a limit, and the moment it fills, arm one stop.
Chaining two orders where the second must not exist until the first is done.
When NOT to Use:
When the follow-up should be a target AND a stop — use
binance_place_otoco_order.When both orders should be live at once — that is
binance_place_oco_order.
Returns:
A confirmation echoing orderListId, contingencyType, listStatusType, listOrderStatus,
listClientOrderId and a ### Legs table. A pending leg reported as PENDING_NEW is
NOT on the book yet; the table shows exactly what Binance said and nothing more.
Examples: params = {"symbol": "BTCUSDT", "working_type": "LIMIT", "working_side": "BUY", "working_price": "60000.00", "working_quantity": "0.001", "working_time_in_force": "GTC", "pending_type": "LIMIT", "pending_side": "SELL", "pending_quantity": "0.001", "pending_price": "66000.00", "pending_time_in_force": "GTC", "list_client_order_id": "entry-then-target-001"} params = {"symbol": "BTCUSDT", "working_type": "LIMIT_MAKER", "working_side": "BUY", "working_price": "60000.00", "working_quantity": "0.001", "pending_type": "STOP_LOSS", "pending_side": "SELL", "pending_quantity": "0.001", "pending_stop_price": "57000.00"}
Error Handling:
Error: … trading is disabled …→ the kill-switch is off; nothing was sent.-2010 / -1013 / -1111 are balance, filter and precision failures on either leg.
-2021 means the working LIMIT_MAKER would have taken liquidity immediately.
A 5xx or a timeout means the execution status is UNKNOWN — query with
binance_get_order_listbefore retrying; a duplicate entry is real money.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |