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

t1

1

TICK

m1

1

MIN

m5

5

MIN

m15

15

MIN

m30

30

MIN

H1

1

HOUR

H2

2

HOUR

H3

3

HOUR

H4

4

HOUR

H6

6

HOUR

H8

8

HOUR

D1

1

DAY

W1

1

WEEK

M1

1

MONTH

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

getId

Gets a unique identifier of a time frame.

getSize

Gets the number of units in a time frame.

getUnit

Gets a unit of measurement for a time frame.

back