public final class MarketDataFxRateProvider extends Object implements FxRateProvider, org.joda.beans.ImmutableBean, Serializable
This decorates an instance of MarketData to provide FX rates.
The FX rates provided are obtained via a triangulation process. To find the FX rate for the currency pair AAA/BBB:
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
fxRate(Currency baseCurrency,
Currency counterCurrency) |
ObservableSource |
getFxRatesSource()
Gets the source of market data for FX rates.
|
MarketData |
getMarketData()
Gets the market data that provides the FX rates.
|
Optional<Currency> |
getTriangulationCurrency()
Gets the triangulation currency to use.
|
int |
hashCode() |
static org.joda.beans.TypedMetaBean<MarketDataFxRateProvider> |
meta()
The meta-bean for
MarketDataFxRateProvider. |
org.joda.beans.TypedMetaBean<MarketDataFxRateProvider> |
metaBean() |
static MarketDataFxRateProvider |
of(MarketData marketData)
Obtains an instance which takes FX rates from the market data.
|
static MarketDataFxRateProvider |
of(MarketData marketData,
ObservableSource fxRatesSource)
Obtains an instance which takes FX rates from the market data,
specifying the source of FX rates.
|
static MarketDataFxRateProvider |
of(MarketData marketData,
ObservableSource fxRatesSource,
Currency triangulationCurrency)
Obtains an instance which takes FX rates from the market data,
specifying the source of FX rates.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitconvert, convert, fxRate, lazy, minimal, noConversionpublic static MarketDataFxRateProvider of(MarketData marketData)
marketData - market data used for looking up FX ratespublic static MarketDataFxRateProvider of(MarketData marketData, ObservableSource fxRatesSource)
The source of FX rates is rarely needed, as most applications only need one set of FX rates.
marketData - market data used for looking up FX ratesfxRatesSource - the source of market data for FX ratespublic static MarketDataFxRateProvider of(MarketData marketData, ObservableSource fxRatesSource, Currency triangulationCurrency)
The source of FX rates is rarely needed, as most applications only need one set of FX rates.
marketData - market data used for looking up FX ratesfxRatesSource - the source of market data for FX ratestriangulationCurrency - the triangulation currency to usepublic double fxRate(Currency baseCurrency, Currency counterCurrency)
fxRate in interface FxRateProviderpublic static org.joda.beans.TypedMetaBean<MarketDataFxRateProvider> meta()
MarketDataFxRateProvider.public org.joda.beans.TypedMetaBean<MarketDataFxRateProvider> metaBean()
metaBean in interface org.joda.beans.Beanpublic MarketData getMarketData()
public ObservableSource getFxRatesSource()
public Optional<Currency> getTriangulationCurrency()
If specified, this currency is used to triangulate FX rates in preference to the standard approach. This would be useful if all FX rates are supplied relative to a currency other than USD.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.