Home Platform Algorithms Charts Pricing Documentation Register Account

Price price.*

The price data contains current bid and ask prices. The topic is in the form "price.<instrumentId>". Instrument IDs are in the form "<symbol>:<broker>".

Request

Request a snapshot of most recent price.

Send

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

Example:

socket.send('["request", "price.EUR/USD:FXCM"]')

Receive

The response will take the form:

message array [topic, price]
topic string
The price topic in the form `price.<instrumentId>`.
price object
The price 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", "price.*"]
instruction string = "subscribe"
Specify that message is an instruction to begin streaming data.
topic string
The price topic in the form `price.<instrumentId>`.

Instrument IDs are in the form <symbol>:<broker>

Example:

socket.send('["subscribe", "price.EUR/USD:FXCM"]')

Receive

Subscription updates are identical to the response above.

Fields

FieldTypeFXCMOANDABitMEXBinanceBitfinex
time
Timestamp as ISO string
string
instrumentId
Instrument identifier
string
bid
Bid price
number
ask
Ask price
number
open
Trading open
boolean

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