class IO2GMarketDataSnapshotResponseReader
Parents | |
IAddRef |
Brief
The class reads a stream of historical prices.
Details
If you need historical prices information, you must request it. The process of requesting historical prices consists of several steps that are described in the How to get historical prices section.
As an answer to the historical prices request, the trading server sends a response object
of the MarketDataSnapshot type.
This object is the response
parameter in your implementation of the
IO2GResponseListener
.onRequestCompleted
method.
To process the response contents, you must use an instance of the IO2GMarketDataSnapshotResponseReader
class.
To create an instance of the IO2GMarketDataSnapshotResponseReader
class, pass the response object as an argument to the
IO2GResponseReaderFactory
.createMarketDataSnapshotReader
method.
For example,
O2GMarketDataSnapshotResponseReader marketDataReader = factory.createMarketDataSnapshotReader(response);
Example
Get historical ask prices [hide]
void ResponseListener::onRequestCompleted(const char *requestId, IO2GResponse *response) { //... if (response->getType() == MarketDataSnapshot) { O2G2Ptr<IO2GResponseReaderFactory> factory = mSession->getResponseReaderFactory(); if (factory) { O2G2Ptr<IO2GMarketDataSnapshotResponseReader> reader = factory->createMarketDataSnapshotReader(response); //... } } }
Public Methods | |
Gets the ask price of a tick. |
|
Gets the close price of an ask bar. |
|
Gets the highest price of an ask bar. |
|
Gets the lowest price of an ask bar. |
|
Gets the open price of an ask bar. |
|
Gets the bid price of a tick. |
|
Gets the close price of a bid bar. |
|
Gets the highest price of a bid bar. |
|
Gets the lowest price of a bid bar. |
|
Gets the open price of a bid bar. |
|
Gets an instance of the calendar representing a tick's date/time or the beginning of a bar's date/time. |
|
Gets a calendar instance representing the date and time of the last tick of the last bar. |
|
Gets the last bar tick volume. |
|
Gets the tick volume of a bar. |
|
Checks whether the historical prices in the response are represented as bars or ticks. |
|
Gets the number of bars or ticks in the reader. |