Executions executions
Request executions history (fills) and subscribe to updates from your connected exchange accounts.
Request
Request recent executions.
Send
- message array ["request", "executions", requestId?]
- instruction string = "request"
- Specify that message is a request for data.
- topic string = "executions"
- The executions topic.
- requestId string
- (Optional) Any string to correlate the response.
Example:
socket.send('["request", "executions"]');
Receive
The response will take the form:
- message array [topic, data]
- topic string
- The executions topic.
- executions array [execution, ...]
- An array of executions.
- execution object
- The execution data with fields below.
Where no requestId
is sent, a separate message will be received on the executions
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 execution 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 execution updates.
Send
- message array ["subscribe", "executions"]
- instruction string = "subscribe"
- Specify that message is an instruction to begin streaming data.
- topic string
- The executions topic.
Example:
socket.send('["subscribe", "executions"]');
Receive
Subscription updates are identical to the response above. When first subscribing, the server will also respond with recent executions from each connected exchange. These will have a property snapshot
set to true
, which can be used to distinguish from live execution updates.
Fields
Field | Type | Values | FXCM | OANDA | BitMEX | Binance | Bitfinex |
---|---|---|---|---|---|---|---|
broker | string | FXCM [1] OANDA [1] BitMEX Binance Bitfinex | ✔ | ✔ | ✔ | ||
id | string | ✔ | ✔ | ✔ | |||
instrumentId | string | ✔ | ✔ | ✔ | |||
symbol | string | ✔ | ✔ | ✔ | |||
time | string | ✔ | ✔ | ✔ | |||
side | string | BUY SELL | ✔ | ✔ | ✔ | ||
quantity | number | ✔ | ✔ | ✔ | |||
price | number | ✔ | ✔ | ✔ | |||
orderId | string | ✔ | ✔ | ✔ | |||
orderType | string | MARKET LIMIT STOP STOP_LIMIT MARKET_IF_TOUCHED LIMIT_IF_TOUCHED PEGGED TAKE_PROFIT TAKE_PROFIT_LIMIT LIMIT_MAKER | ✔ | ✔ | ✔ | ||
orderPrice | number | ✔ | ✔ | ✔ | |||
orderStatus | string | PARTIALLY_FILLED FILLED | ✔ | ✔ | ✔ | ||
maker | boolean | ✔ | ✔ | ||||
fee | number | ✔ | ✔ | ✔ | |||
feeCurrency | string | ✔ | ✔ | ||||
detail | string | ✔ | |||||
quantityRemaining | number | ✔ | |||||
snapshot | boolean | ✔ | ✔ | ✔ |
Notes
[1] FXCM and OANDA do not implement executions.
Was this page useful? If you find any errors or have any questions please get in touch at support@cloud9trader.com.