Home Platform Algorithms Charts Pricing Documentation Register Account

Trades trades.*

Public trades (fills/executions matched on the exchange) on topic "trades.<instrumentId>". Instrument IDs are in the form "<symbol>:<broker>".

Request

Request a snapshot of recent trades.

Send

message array ["request", "trades.*"]
instruction string = "request"
Specify that message is a request for data.
topic string
The trades topic in the form `trades.<instrumentId>`.
requestId string
(Optional) Any string to correlate the response.

Example:

socket.send('["request", "trades.BTCUSD:Bitfinex"]')

Receive

The response will take the form:

message array [topic, trades]
topic string
The trades topic in the form `trades.<instrumentId>`.
trades array [trade, ...]
An array of trades in time ascending order.
trade object
Trade data with fields below.

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

Subscribe

Subscribe to price feed updates.

Send

message array ["subscribe", "trades.*"]
instruction string = "subscribe"
Specify that message is an instruction to begin streaming data.
topic string
The trades topic in the form `trades.<instrumentId>`.

Example:

socket.send('["subscribe", "trades.BTCUSD:Bitfinex"]')

Receive

Subscription updates are identical to the response above.

Fields

FieldTypeValuesFXCMOANDABitMEXBinanceBitfinex
id
Trade ID
string
time
Timestamp as ISO string
string
price
The price traded at
number
quantity
The amount traded
number
side
The amount traded
numberBUY
SELL

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