public final class ForwardFxIndexRates extends Object implements FxIndexRates, org.joda.beans.ImmutableBean, Serializable
This provides rates for a single currency pair FX index.
This implementation is based on an underlying FxForwardRates
instance.
Modifier and Type | Class and Description |
---|---|
static class |
ForwardFxIndexRates.Meta
The meta-bean for
ForwardFxIndexRates . |
Modifier and Type | Method and Description |
---|---|
MultiCurrencyAmount |
currencyExposure(FxIndexSensitivity pointSensitivity)
Calculates the currency exposure from the point sensitivity.
|
boolean |
equals(Object obj) |
<T> Optional<T> |
findData(MarketDataName<T> name) |
LocalDateDoubleTimeSeries |
getFixings()
Gets the time-series of fixings, defaulted to an empty time-series.
|
FxForwardRates |
getFxForwardRates()
Gets the underlying FX forward rates.
|
FxIndex |
getIndex()
Gets the index that the rates are for.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
LocalDate |
getValuationDate() |
int |
hashCode() |
static ForwardFxIndexRates.Meta |
meta()
The meta-bean for
ForwardFxIndexRates . |
ForwardFxIndexRates.Meta |
metaBean() |
static ForwardFxIndexRates |
of(FxIndex index,
FxForwardRates fxForwardRates)
Obtains an instance based on discount factors with no historic fixings.
|
static ForwardFxIndexRates |
of(FxIndex index,
FxForwardRates fxForwardRates,
LocalDateDoubleTimeSeries fixings)
Obtains an instance based on discount factors and historic fixings.
|
CurrencyParameterSensitivities |
parameterSensitivity(FxIndexSensitivity pointSensitivity)
Calculates the parameter sensitivity from the point sensitivity.
|
double |
rate(FxIndexObservation observation,
Currency baseCurrency)
Gets the historic or forward rate at the specified fixing date.
|
PointSensitivityBuilder |
ratePointSensitivity(FxIndexObservation observation,
Currency baseCurrency)
Calculates the point sensitivity of the historic or forward rate at the specified fixing date.
|
String |
toString() |
ForwardFxIndexRates |
withFxForwardRates(FxForwardRates fxForwardRates)
Returns a new instance with different FX forward rates.
|
ForwardFxIndexRates |
withParameter(int parameterIndex,
double newValue) |
ForwardFxIndexRates |
withPerturbation(ParameterPerturbation perturbation) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findParameterIndex
public static ForwardFxIndexRates of(FxIndex index, FxForwardRates fxForwardRates)
The instance is based on the discount factors for each currency.
index
- the indexfxForwardRates
- the underlying forward FX ratespublic static ForwardFxIndexRates of(FxIndex index, FxForwardRates fxForwardRates, LocalDateDoubleTimeSeries fixings)
The instance is based on the discount factors for each currency.
index
- the indexfxForwardRates
- the underlying forward FX ratesfixings
- the time-series of fixingspublic LocalDate getValuationDate()
getValuationDate
in interface MarketDataView
public <T> Optional<T> findData(MarketDataName<T> name)
findData
in interface MarketDataView
public int getParameterCount()
getParameterCount
in interface ParameterizedData
public double getParameter(int parameterIndex)
getParameter
in interface ParameterizedData
public ParameterMetadata getParameterMetadata(int parameterIndex)
getParameterMetadata
in interface ParameterizedData
public ForwardFxIndexRates withParameter(int parameterIndex, double newValue)
withParameter
in interface ParameterizedData
withParameter
in interface FxIndexRates
public ForwardFxIndexRates withPerturbation(ParameterPerturbation perturbation)
withPerturbation
in interface ParameterizedData
withPerturbation
in interface FxIndexRates
public double rate(FxIndexObservation observation, Currency baseCurrency)
FxIndexRates
The rate of the FX index varies over time. This method obtains the actual or estimated rate for the fixing date.
This retrieves the actual rate if the fixing date is before the valuation date, or the estimated rate if the fixing date is after the valuation date. If the fixing date equals the valuation date, then the best available rate is returned.
The index defines the conversion rate for a specific currency pair. This method specifies which of the two currencies in the index is to be treated as the base currency for the purposes of the returned rate. If the specified base currency equals the base currency of the index, then the rate is simply returned. If the specified base currency equals the counter currency of the index, then the inverse rate is returned. As such, an amount in the specified base currency can be directly multiplied by the returned FX rate to perform FX conversion.
To convert an amount in the specified base currency to the other currency, multiply it by the returned FX rate.
rate
in interface FxIndexRates
observation
- the rate observation, including the fixing datebaseCurrency
- the base currency that the rate should be expressed againstpublic PointSensitivityBuilder ratePointSensitivity(FxIndexObservation observation, Currency baseCurrency)
FxIndexRates
This returns a sensitivity instance referring to the points that were queried in the market data.
If a time-series was used, then there is no sensitivity.
The sensitivity refers to the result of FxIndexRates.rate(FxIndexObservation, Currency)
.
ratePointSensitivity
in interface FxIndexRates
observation
- the rate observation, including the fixing datebaseCurrency
- the base currency that the rate should be expressed againstpublic CurrencyParameterSensitivities parameterSensitivity(FxIndexSensitivity pointSensitivity)
FxIndexRates
This is used to convert a single point sensitivity to parameter sensitivity.
parameterSensitivity
in interface FxIndexRates
pointSensitivity
- the point sensitivity to convertpublic MultiCurrencyAmount currencyExposure(FxIndexSensitivity pointSensitivity)
FxIndexRates
This is used to convert a single point sensitivity to currency exposure.
currencyExposure
in interface FxIndexRates
pointSensitivity
- the point sensitivity to convertpublic ForwardFxIndexRates withFxForwardRates(FxForwardRates fxForwardRates)
fxForwardRates
- the new FX forward ratespublic static ForwardFxIndexRates.Meta meta()
ForwardFxIndexRates
.public ForwardFxIndexRates.Meta metaBean()
metaBean
in interface org.joda.beans.Bean
public FxIndex getIndex()
getIndex
in interface FxIndexRates
public FxForwardRates getFxForwardRates()
getFxForwardRates
in interface FxIndexRates
public LocalDateDoubleTimeSeries getFixings()
getFixings
in interface FxIndexRates
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.