Home Platform Algorithms Charts Pricing Documentation Register Account

Orders orders

Request your order history and subscribe to updates from your connected exchange accounts.

Request

Request active and recent orders.

Send

message array ["request", "orders", requestId?]
instruction string = "request"
Specify that message is a request for data.
topic string = "orders"
The orders topic.
requestId string
(Optional) Any string to correlate the response.

Example:

socket.send('["request", "orders"]');

Receive

The response will take the form:

message array [topic, data]
topic string
The orders topic.
orders array [order, ...]
An array of orders.
order object
The order data with fields below.

Where no requestId is sent, a separate message will be received on the orders channel for each connected exchange. This matches the behavior of the initial snapshot messages after subscription, described below.

Where requestId is sent, a single message will be received with order from all exchanges once they have all responded.

See Message Structure for the format of responses to requests made with a requestId.

Subscribe

Subscribe to order updates.

Send

message array ["subscribe", "orders"]
instruction string = "subscribe"
Specify that message is an instruction to begin streaming data.
topic string
The orders topic.

Example:

socket.send('["subscribe", "orders"]');

Receive

Subscription updates are identical to the response above. When first subscribing, the server will also respond with active and historical orders from each connected exchange. These will have a property snapshot set to true, which can be used to distinguish from live order updates.

Fields

FieldTypeValuesFXCMOANDABitMEXBinanceBitfinex
brokerstringFXCM
OANDA [1]
BitMEX
Binance
Bitfinex
idstring
accountNostring
sessionIdstring
currencystring
instrumentIdstring
symbolstring
sidestringBUY
SELL
quantitynumber
quantityFillednumber
quantityRemainingnumber
typestringMARKET
LIMIT
STOP
STOP_LIMIT
MARKET_IF_TOUCHED
LIMIT_IF_TOUCHED
PEGGED
TAKE_PROFIT
TAKE_PROFIT_LIMIT
LIMIT_MAKER
timeInForcestringGTC
IOC
FOK
positionIdstring
pricenumber
stopPricenumber
statusstringNEW
PARTIALLY_FILLED
FILLED
CANCELED
REJECTED
EXPIRED
detailstring
settlementCurrencystring
averagePricestring
icebergQuantitystring
snapshotboolean

Notes

[1] OANDA does not implement orders.

Was this page useful? If you find any errors or have any questions please get in touch at support@cloud9trader.com.