binance_cancel_all_open_orders
Cancel every open order on a symbol, including OCO/OTO legs, in one API call. Use to flatten positions or reset strategy when many orders must go quickly.
Instructions
Cancel EVERY open order on one symbol, including order-list legs.
Calls DELETE /api/v3/openOrders (SIGNED, IP weight 1). This is a blunt instrument:
it takes no id and cancels whatever is resting on that symbol, OCO/OTO lists included
(their legs come back as order-list objects with orderReports[]).
Kill-switch. Refused with Error: … trading is disabled … unless the server runs
with BINANCE_ALLOW_TRADING=1.
When to Use:
Flattening the working orders on one symbol — a stop-out or a strategy reset.
When several orders must go and cancelling them one by one would race the market.
When NOT to Use:
When one specific order should go — use
binance_cancel_orderwith an id.To see what would be cancelled first — call
binance_get_open_orderswith the same symbol; that read is free of consequence and this one is not.
Returns:
A confirmation listing every cancelled order, plus a section per cancelled order list
(orderListId, contingencyType, and each leg from orderReports[]).
Examples: params = {"symbol": "BTCUSDT"}
Error Handling:
-2011 means there was nothing open on that symbol. A 5xx/timeout leaves the outcome
UNKNOWN — re-read with binance_get_open_orders rather than assuming either way.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |