Cancel all orders
If there are open orders, you first receive a notification that the cancellations are booked, followed by a separate Order Closed notification for each order. Passing an instrument_code results in even faster cancellations.
The exchange's reply, whether the booked notification or an error, is passed on exactly as the exchange sends it, without echoing your request. Before the request reaches the exchange, it can be refused with NOT_AUTHENTICATED, NOT_SUBSCRIBED_TO_TRADING_CHANNEL or RATE_LIMITED; if it cannot be passed on, it is answered with INTERNAL_ERROR.
Private. Create, move and cancel orders, and receive a feed of order updates based on the trading activity in your account. You must be authenticated (token with the Trade permission) and subscribed to this channel to send trading messages. Order requests share one rate limit per account (see Rate limits).
apiTokenAuthorizationBearer <token>API token sent in the AUTHENTICATE message (not as a header). Generate it in the One Trading UI with the Trade permission; a valid token authorises all private channels for the connection.
const payload = { "type": "CANCEL_ALL_ORDERS", "instrument_code": "BTC_EUR"};const socket = new WebSocket("wss://streams.fast.onetrading.com/");socket.addEventListener("open", () => { socket.send(JSON.stringify(payload));});Passing an instrument_code results in even faster cancellations.
- payload
type*stringinstrument_code?stringOptional instrument code to cancel orders only on this market.
Cancel all BTC_EUR orders
{ "type": "CANCEL_ALL_ORDERS", "instrument_code": "BTC_EUR"}Reply
Sent back on the same channel.