public interface FxForwardRates extends MarketDataView, ParameterizedData
This provides forward rates for a single pair
, such as 'EUR/GBP'.
The forward rate is the conversion rate between two currencies on a fixing date in the future.
Modifier and Type | Method and Description |
---|---|
MultiCurrencyAmount |
currencyExposure(FxForwardSensitivity pointSensitivity)
Calculates the currency exposure from the point sensitivity.
|
CurrencyPair |
getCurrencyPair()
Gets the currency pair.
|
LocalDate |
getValuationDate()
Gets the valuation date.
|
CurrencyParameterSensitivities |
parameterSensitivity(FxForwardSensitivity pointSensitivity)
Calculates the parameter sensitivity from the point sensitivity.
|
double |
rate(Currency baseCurrency,
LocalDate referenceDate)
Gets the forward rate at the specified payment date.
|
double |
rateFxSpotSensitivity(Currency baseCurrency,
LocalDate referenceDate)
Calculates the sensitivity of the forward rate to the current FX rate.
|
PointSensitivityBuilder |
ratePointSensitivity(Currency baseCurrency,
LocalDate referenceDate)
Calculates the point sensitivity of the forward rate at the specified payment date.
|
FxForwardRates |
withParameter(int parameterIndex,
double newValue) |
FxForwardRates |
withPerturbation(ParameterPerturbation perturbation) |
findData
findParameterIndex, getParameter, getParameterCount, getParameterMetadata
CurrencyPair getCurrencyPair()
The the currency pair that the forward rates are for.
LocalDate getValuationDate()
The raw data in this provider is calibrated for this date.
getValuationDate
in interface MarketDataView
FxForwardRates withParameter(int parameterIndex, double newValue)
withParameter
in interface ParameterizedData
FxForwardRates withPerturbation(ParameterPerturbation perturbation)
withPerturbation
in interface ParameterizedData
double rate(Currency baseCurrency, LocalDate referenceDate)
The exchange rate of the currency pair varies over time. This method obtains the estimated rate for the payment date.
This method specifies which of the two currencies in the currency pair 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 currency pair, then the rate is simply returned. If the specified base currency equals the counter currency of the currency pair, 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.
baseCurrency
- the base currency that the rate should be expressed againstreferenceDate
- the date to query the rate forRuntimeException
- if the value cannot be obtainedPointSensitivityBuilder ratePointSensitivity(Currency baseCurrency, LocalDate referenceDate)
This returns a sensitivity instance referring to the points that were queried in the market data.
The sensitivity refers to the result of rate(Currency, LocalDate)
.
baseCurrency
- the base currency that the rate should be expressed againstreferenceDate
- the date to find the sensitivity forRuntimeException
- if the value cannot be obtaineddouble rateFxSpotSensitivity(Currency baseCurrency, LocalDate referenceDate)
This returns the sensitivity to the current FX rate that was used to determine the FX forward rate.
The sensitivity refers to the result of rate(Currency, LocalDate)
.
baseCurrency
- the base currency that the rate should be expressed againstreferenceDate
- the date to find the sensitivity forRuntimeException
- if the value cannot be obtainedCurrencyParameterSensitivities parameterSensitivity(FxForwardSensitivity pointSensitivity)
This is used to convert a single point sensitivity to parameter sensitivity.
pointSensitivity
- the point sensitivity to convertRuntimeException
- if the result cannot be calculatedMultiCurrencyAmount currencyExposure(FxForwardSensitivity pointSensitivity)
This is used to convert a single point sensitivity to currency exposure.
pointSensitivity
- the point sensitivity to convertRuntimeException
- if the result cannot be calculatedCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.