public method IO2GRequestFactory.createMarketDataSnapshotRequestInstrument
Brief
Creates a market data snapshot (get price history) request.
Declaration | ||||
|
Parameters | |
instrument |
The instrument to get the snapshot for. The instrument specified must be exactly the same
as the instrument name returned by the |
timeframe |
The time frame. The time frame must be one of the time frames from |
maxBars |
The maximum number of bars. Please note that the maximum number of the bars must not exceed
the maximum number of bars specified in the server
properties (300 on most servers). Even if a bigger number is specified in the request,
the server will return the maximum number of bars specified in its configuration.
This value can be obtained by |
Details
The market data snapshot request returns historical price data for the specified instrument.
createMarketDataSnapshotRequestInstrument [hide]
IO2GRequestFactory *factory = session->getRequestFactory(); IO2GTimeframeCollection *timeframe_collection = factory->getTimeFrameCollection(); IO2GTimeframe *timeframe = timeframe_collection->get("m1"); timeframe_collection->release(); IO2GRequest *request = factory->createMarketDataSnapshotRequestInstrument(instrument.c_str(), timeframe, timeframe->getQueryDepth()); //... timeframe->release(); factory->release();
To specify the date/time range, please use the
fillMarketDataSnapshotRequestTime
method after createMarketDataSnapshotRequestInstrument
. If the date/time range is not specified, the request will return most recent data.
The response to this request will have the MarketDataSnapshot
type and must be
parsed using the IO2GMarketDataSnapshotResponseReader
class.
The returned object must be released using the release
method when it is not used anymore.
Declared in IO2GRequestFactory