-
Notifications
You must be signed in to change notification settings - Fork 0
BitMEX Websocket QUOTE Stream
Please refer to the Home Page for the common logic to interpret messages
The QUOTE stream is a stream that updates you about the current BID and ASK for an instrument, this include the highest Bid Price and its size and the lowest Ask Price and its size.
The Quote is practically the current trading price of an instrument.
Properties included for the Quote object are:
- Timestamp, for the timestamp of the value
- Symbol, a string for the instrument example XBTUSD
- Ask Price, current lowest ask price
- Ask Size, current ask size
- Bid Price, current highest bid price
- Bid Size, current bid size
The only method of the class is UpdateFromWebsocket
which is called once a message containing "quote" is received and deserialised. The method updates the object's values with the new ones.
Since there can be several updates of price/size between a websocket message and another, the message almost always includes a series of quotes. During the deserialization we also keep the latest value of the quote, which is the most recent.