public method O2GRequestFactory.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
returned by the |
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. |
Details
The market data snapshot request returns historical price data for the specified instrument.
createMarketDataSnapshotRequestInstrument [hide]
O2GRequestFactory factory = mSession.getRequestFactory(); O2GTimeframeCollection timeFrames = factory.Timeframes; O2GTimeframe timeFrame = timeFrames["m1"]; O2GRequest request = factory.createMarketDataSnapshotRequestInstrument("EUR/USD", timeFrame, 300);
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 O2GMarketDataSnapshotResponseReader
class.
Declared in O2GRequestFactory