com.oanda.fxtrade.api
Interface RateTable


public interface RateTable

The RateTable object holds all incoming rate information. A ratetable is used to obtain rate info (quotes for currency pairs) and history data for these as well.

See Also:
User

Method Summary
 Instrument get(java.lang.String symbol)
          Deprecated. use getInstrument instead
 java.util.Collection<FXPair> getAllSymbols()
          Deprecated. Use getAllSymbols(homeCurrency) instead
 java.util.Collection<FXPair> getAllSymbols(java.lang.String homeCurrency)
          Retrieves all pairs both tradeable and non-tradable with respect to a home currency.
 java.util.Vector<? extends CandlePoint> getCandles(FXPair pair, long intervalInMillisec, int numberOfCandles)
          Obtain the current history (in terms of CandlePoints) of a given currency pair at a given millisecond interval of a particular length (numberOfCandles).
 java.util.Vector<? extends CandlePoint> getCandles(FXPair pair, long intervalInMillisec, int numberOfCandles, long startTime, long endTime)
          Obtain the current history (in terms of CandlePoints) of a given currency pair at a given millisecond interval of a particular length (numberOfCandles).
 FXEventManager getEventManager()
          Get the event manager for this RateTable
 java.util.Vector<? extends FXHistoryPoint> getHistory(FXPair pair, long intervalInMillisec, int numberOfPoints)
          Obtain the current history (in terms of FXHistoryPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints).
 java.util.Vector<? extends FXHistoryPoint> getHistory(FXPair pair, long intervalInMillisec, int numberOfPoints, CacheMode cacheMode)
          Obtain the current history (in terms of FXHistoryPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints).
 java.util.Vector<? extends FXHistoryPoint> getHistory(FXPair pair, long intervalInMillisec, int numberOfPoints, long startTime, long endTime, CacheMode cacheMode)
          Obtain the current history (in terms of FXHistoryPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints).
 Instrument getInstrument(java.lang.String symbol)
          Retrieves instrument object for given symbol
 java.util.Vector<? extends MinMaxPoint> getMinMaxs(FXPair pair, long interval, int numberOfPoints)
          Obtain the current history (in terms of MinMaxPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints).
 java.util.Vector<? extends MinMaxPoint> getMinMaxs(FXPair pair, long interval, int numberOfPoints, long startTime, long endTime)
          Obtain the current history (in terms of MinMaxPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints).
 java.util.Vector<FXPair> getPairs()
          Deprecated. Use getAllSymbols(homeCurrency) instead
 FXTick getRate(FXPair pair)
          Returns the most recent FXTick for the given FXPair without ladder markup.
 FXTick getRateForUnits(FXPair pair, long units)
          Returns the most recent FXTick for the given FXPair in the correct rung.
 java.util.Collection<FXTick> getRatesForAllUnits(FXPair pair)
          Returns the most recent FXTick for the given FXPair in all ladders.
 boolean loggedIn()
          Check whether the session is active.
 

Method Detail

getCandles

java.util.Vector<? extends CandlePoint> getCandles(FXPair pair,
                                                   long intervalInMillisec,
                                                   int numberOfCandles)
                                                   throws OAException
Obtain the current history (in terms of CandlePoints) of a given currency pair at a given millisecond interval of a particular length (numberOfCandles). Result vector length should not be relied upon to be numberOfCandles - since unreasonably large requests are truncated .

Parameters:
pair -
intervalInMillisec - interval specified in milliseconds, FXClient.getHistory(FXPair, long, int)
numberOfCandles - number of candles to be requested.
Returns:
vector of CandlePoints
Throws:
OAException
See Also:
CandlePoint

getCandles

java.util.Vector<? extends CandlePoint> getCandles(FXPair pair,
                                                   long intervalInMillisec,
                                                   int numberOfCandles,
                                                   long startTime,
                                                   long endTime)
                                                   throws OAException
Obtain the current history (in terms of CandlePoints) of a given currency pair at a given millisecond interval of a particular length (numberOfCandles). Result vector length should not be relied upon to be numberOfCandles - since unreasonably large requests are truncated . start and end time can specified for time range without numberOfCandles.

Parameters:
pair -
intervalInMillisec - interval specified in milliseconds, FXClient.getHistory(FXPair, long, int)
numberOfCandles - number of candles to be requested.
startTime - start of the range in unix time. 0 to disable.
endTime - end of the range in unix time. 0 to disable.
Returns:
vector of CandlePoints
Throws:
OAException
See Also:
CandlePoint

getHistory

java.util.Vector<? extends FXHistoryPoint> getHistory(FXPair pair,
                                                      long intervalInMillisec,
                                                      int numberOfPoints)
                                                      throws OAException
Obtain the current history (in terms of FXHistoryPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints). Locally cached data will be returned in preference to re-fetching from the server.

For example, to get the history for the last 20 hourly bars:

RateTable rateTableInstance = ...; //obtain an instance of the RateTable
FXPair pair = ...; //choose an interesting currency pair
Vector history = rateTableInstance.getHistory( pair, FXClient.INTERVAL_1_HOUR, 20 );

The Vector of FXHistoryPoint is in ascending order by unix timestamp i.e. oldest to newest.

Result vector length should not be relied upon to be numberOfPoints - since unreasonably large requests are truncated.

Since the internet may delay the tick's update, it is possible that the last candles can not show you the correct data.

Parameters:
pair - pair to request history for
intervalInMillisec - interval specified in milliseconds
numberOfPoints - number of ticks in query result
Returns:
vector of FXHistoryPoints
Throws:
OAException
See Also:
FXHistoryPoint, FXClient.getHistory(FXPair, long, int)

getHistory

java.util.Vector<? extends FXHistoryPoint> getHistory(FXPair pair,
                                                      long intervalInMillisec,
                                                      int numberOfPoints,
                                                      CacheMode cacheMode)
                                                      throws OAException
Obtain the current history (in terms of FXHistoryPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints). The caching policy can be specified by the caller.

For example, to get the history for the last 20 hourly bars:

RateTable rateTableInstance = ...; //obtain an instance of the RateTable
FXPair pair = ...; //choose an interesting currency pair
Vector history = rateTableInstance.getHistory( pair, FXClient.INTERVAL_1_HOUR, 20 );

The Vector of FXHistoryPoint is in ascending order by unix timestamp i.e. oldest to newest.

Result vector length should not be relied upon to be numberOfPoints - since unreasonably large requests are truncated.

Since the internet may delay the tick's update, it is possible that the last candles can not show you the correct data.

Parameters:
pair - pair to request history for
intervalInMillisec - interval specified in milliseconds
numberOfPoints - number of ticks in query result
cacheMode - the caching policy to use for the lookup
Returns:
vector of FXHistoryPoints
Throws:
OAException
See Also:
FXHistoryPoint, FXClient.getHistory(FXPair, long, int)

getHistory

java.util.Vector<? extends FXHistoryPoint> getHistory(FXPair pair,
                                                      long intervalInMillisec,
                                                      int numberOfPoints,
                                                      long startTime,
                                                      long endTime,
                                                      CacheMode cacheMode)
                                                      throws OAException
Obtain the current history (in terms of FXHistoryPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints). The caching policy can be specified by the caller.

For example, to get the history for the last 20 hourly bars:

RateTable rateTableInstance = ...; //obtain an instance of the RateTable
FXPair pair = ...; //choose an interesting currency pair
Vector history = rateTableInstance.getHistory( pair, FXClient.INTERVAL_1_HOUR, 20 );

The Vector of FXHistoryPoint is in ascending order by unix timestamp i.e. oldest to newest.

Result vector length should not be relied upon to be numberOfPoints - since unreasonably large requests are truncated.

Since the internet may delay the tick's update, it is possible that the last candles can not show you the correct data.

start and end time can specified for time range without numberOfPoints.

Parameters:
pair - pair to request history for
intervalInMillisec - interval specified in milliseconds
numberOfPoints - number of ticks in query result
cacheMode - the caching policy to use for the lookup
startTime - start of the range in unix time. 0 to disable.
endTime - end of the range in unix time. 0 to disable.
Returns:
vector of FXHistoryPoints
Throws:
OAException
See Also:
FXHistoryPoint, FXClient.getHistory(FXPair, long, int)

getMinMaxs

java.util.Vector<? extends MinMaxPoint> getMinMaxs(FXPair pair,
                                                   long interval,
                                                   int numberOfPoints)
                                                   throws OAException
Obtain the current history (in terms of MinMaxPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints). Result vector length should not be relied upon to be numberOfPoints - since unreasonably large requests are truncated .

Parameters:
pair -
interval -
numberOfPoints -
Returns:
vector of MinMaxPoints
Throws:
OAException
See Also:
MinMaxPoint

getMinMaxs

java.util.Vector<? extends MinMaxPoint> getMinMaxs(FXPair pair,
                                                   long interval,
                                                   int numberOfPoints,
                                                   long startTime,
                                                   long endTime)
                                                   throws OAException
Obtain the current history (in terms of MinMaxPoints) of a given currency pair at a given millisecond interval of a particular length (numberOfPoints). Result vector length should not be relied upon to be numberOfPoints - since unreasonably large requests are truncated . start and end time can specified for time range without numberOfPoints.

Parameters:
pair -
interval -
numberOfPoints -
startTime - start of the range in unix time. 0 to disable.
endTime - end of the range in unix time. 0 to disable.
Returns:
vector of MinMaxPoints
Throws:
OAException
See Also:
MinMaxPoint

getRateForUnits

FXTick getRateForUnits(FXPair pair,
                       long units)
                       throws RateTableException
Returns the most recent FXTick for the given FXPair in the correct rung. If there is no valid rung for the specified units, then null is returned.

Parameters:
pair - the FXPair to retrieve
units - the number of units used to determine the ladder
Returns:
the most recent FXTick in the correct rung, or null if there is not a valid rung
Throws:
RateTableException
See Also:
FXTick, FXPair

getRate

FXTick getRate(FXPair pair)
               throws RateTableException
Returns the most recent FXTick for the given FXPair without ladder markup.

Parameters:
pair - the FXPair to retrieve using no ladder
Returns:
the most recent FXTick
Throws:
RateTableException
See Also:
FXTick, FXPair

getRatesForAllUnits

java.util.Collection<FXTick> getRatesForAllUnits(FXPair pair)
                                                 throws RateTableException
Returns the most recent FXTick for the given FXPair in all ladders.

Parameters:
pair - the pair to get a rate from all ladders for
Returns:
Throws:
RateTableException

loggedIn

boolean loggedIn()
Check whether the session is active.

Returns:
true when the session is active.

getEventManager

FXEventManager getEventManager()
Get the event manager for this RateTable

Returns:
The event manager for this RateTable

get

Instrument get(java.lang.String symbol)
Deprecated. use getInstrument instead

Retrieves instrument object for given symbol

Returns:
instrument object

getInstrument

Instrument getInstrument(java.lang.String symbol)
Retrieves instrument object for given symbol

Returns:
instrument object

getPairs

java.util.Vector<FXPair> getPairs()
                                  throws RateTableException
Deprecated. Use getAllSymbols(homeCurrency) instead

Retrieves all pairs available for trade

Returns:
vector of pairs
Throws:
RateTableException
See Also:
FXPair

getAllSymbols

java.util.Collection<FXPair> getAllSymbols()
                                           throws RateTableException
Deprecated. Use getAllSymbols(homeCurrency) instead

Retrieves all pairs both tradeable and non-tradable with respect to home currencies of last login.

Returns:
collection of pairs
Throws:
RateTableException

getAllSymbols

java.util.Collection<FXPair> getAllSymbols(java.lang.String homeCurrency)
                                           throws RateTableException
Retrieves all pairs both tradeable and non-tradable with respect to a home currency.

Parameters:
homeCurrency - a home currencies for which to retrieve symbols
Returns:
collection of pairs
Throws:
RateTableException


Copyright © 2005 OANDA Corporation. All Rights Reserved.