class O2GTimeframe
Brief
The class provides access to a time frame available for the historical prices request.
Details
The historical prices can be requested for different time frames. Every time frame has a unique identifier, size and unit of measurement.
These properties of a time frame can be accessed by the methods of the class: getId, getSize and getUnit respectively.
The table below shows properties of common time frames:
Identifier |
Size |
Unit of measurement |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The time frame identifier is used as an argument in the
O2GRequestFactory.createMarketDataSnapshotRequestInstrument
method.
To get an instance of the O2GTimeframe class, use one of the implementations of the O2GTimeframeCollection get methods.
Example
Get time frame information [hide]
O2GRequestFactory requestFactory = mSession.getRequestFactory();
O2GTimeframeCollection timeFrames = requestFactory.getTimeFrameCollection();
System.out.println(" Available time frames are:");
for (int i = 0; i < timeFrames.size(); i++) {
O2GTimeframe tF = timeFrames.get(i);
System.out.println(" Timeframe: " + tF.getId() +
" Size = " + tF.getSize() +
" Unit of measure = " + tF.getUnit());
}
The namespace is com.fxcore2.
| Public Methods | |
|
Gets a unique identifier of a time frame. |
|
|
Gets the number of units in a time frame. |
|
|
Gets a unit of measurement for a time frame. |
|