public method O2GRequestFactory.fillMarketDataSnapshotRequestTime

Brief

Fills the date/time range of the market data snapshot.

Declaration
Java
void  fillMarketDataSnapshotRequestTime (O2GRequest request, java.util.Calendar timeFrom, java.util.Calendar timeTo, boolean isIncludeWeekends)

Parameters
request

The request object previously created using the createMarketDataSnapshotRequestInstrument method.

timeFrom

The date and time to get the snapshot from.

timeTo

The date and time to get the snapshot to.

isIncludeWeekends

Defines whether weekend price data will be requested from the server. If the value is true, the market data will include weekend price data. Note: if it is not specified in a request that isIncludeWeekends==true, the response may contain less bars than it was originally specified in the request in maxBars.

If the value is false, the market data will include data from Monday through Friday.

Details

fillMarketDataSnapshotRequestTime is the last step to get historic prices and used after createMarketDataSnapshotRequestInstrument.
The date/time is in the UTC time zone.
If timeTo is null, the server will send most recent data.
If timeFrom is null, the server will send the maximum number of bars specified in the request.
If timeFrom is not null but the chosen date rage contains more bars than the maximum number of bars, the maximum number of bars will be returned ending at the specified dateTo.

fillMarketDataSnapshotRequestTime [hide]

static Calendar calFirst = null;
static Calendar calDate = null;
//...
O2GRequestFactory requestFactory = mSession.getRequestFactory();
if (requestFactory == null) {
    return;
}
O2GTimeframeCollection timeFrames = requestFactory.getTimeFrameCollection();
O2GTimeframe timeFrame = timeFrames.get("m1");
if (timeFrame != null) {
    request = requestFactory.createMarketDataSnapshotRequestInstrument("EUR/USD", timeFrame, 300);
    requestFactory.fillMarketDataSnapshotRequestTime(request, calFrom, calTo, false);
    //...
}

Declared in O2GRequestFactory

back