public final class ImmutableRatesProvider extends Object implements RatesProvider, org.joda.beans.ImmutableBean, Serializable
This provides the environmental information against which pricing occurs. This includes FX rates, discount factors and forward curves.
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableRatesProvider.Meta
The meta-bean for
ImmutableRatesProvider. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableRatesProviderBuilder |
builder(LocalDate valuationDate)
Creates a builder specifying the valuation date.
|
static ImmutableRatesProvider |
combined(FxRateProvider fx,
ImmutableRatesProvider... providers)
Combines a number of rates providers.
|
ImmutableRatesProvider |
combinedWith(ImmutableRatesProvider other,
FxRateProvider fxProvider)
Combines this provider with another.
|
<T> T |
data(MarketDataId<T> id)
Gets market data of a specific type.
|
DiscountFactors |
discountFactors(Currency currency)
Gets the discount factors for a currency.
|
boolean |
equals(Object obj) |
<T> Optional<T> |
findData(MarketDataName<T> name)
Finds the market data with the specified name.
|
FxForwardRates |
fxForwardRates(CurrencyPair currencyPair)
Gets the forward FX rates for a currency pair.
|
FxIndexRates |
fxIndexRates(FxIndex index)
Gets the rates for an FX index.
|
double |
fxRate(Currency baseCurrency,
Currency counterCurrency)
Gets the FX rate for the specified currency pair on the valuation date.
|
Map<CurveName,Curve> |
getCurves()
Returns a map containing all the curves, keyed by curve name.
|
Map<CurveId,Curve> |
getCurves(CurveGroupName groupName)
Returns a map containing all the curves, keyed by curve identifier.
|
ImmutableSet<Currency> |
getDiscountCurrencies()
Gets the set of currencies that discount factors are provided for.
|
ImmutableMap<Currency,Curve> |
getDiscountCurves()
Gets the discount curves, defaulted to an empty map.
|
FxRateProvider |
getFxRateProvider()
Gets the provider of foreign exchange rates.
|
ImmutableSet<IborIndex> |
getIborIndices()
Gets the set of Ibor indices that are available.
|
ImmutableMap<Index,Curve> |
getIndexCurves()
Gets the forward curves, defaulted to an empty map.
|
ImmutableSet<OvernightIndex> |
getOvernightIndices()
Gets the set of Overnight indices that are available.
|
ImmutableSet<PriceIndex> |
getPriceIndices()
Gets the set of Price indices that are available.
|
ImmutableMap<Index,LocalDateDoubleTimeSeries> |
getTimeSeries()
Gets the time-series, defaulted to an empty map.
|
ImmutableSet<Index> |
getTimeSeriesIndices()
Gets the set of indices that have time-series available.
|
LocalDate |
getValuationDate()
Gets the valuation date.
|
int |
hashCode() |
IborIndexRates |
iborIndexRates(IborIndex index)
Gets the rates for an Ibor index.
|
Stream<Index> |
indices()
Gets the forward indices that are available.
|
static ImmutableRatesProvider.Meta |
meta()
The meta-bean for
ImmutableRatesProvider. |
ImmutableRatesProvider.Meta |
metaBean() |
OvernightIndexRates |
overnightIndexRates(OvernightIndex index)
Gets the rates for an Overnight index.
|
PriceIndexValues |
priceIndexValues(PriceIndex index)
Gets the values for an Price index.
|
LocalDateDoubleTimeSeries |
timeSeries(Index index)
Gets the time series.
|
ImmutableRatesProviderBuilder |
toBuilder()
Converts this instance to a builder allowing changes to be made.
|
ImmutableRatesProvider |
toImmutableRatesProvider()
Converts this provider to an equivalent
ImmutableRatesProvider. |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcurrencyExposure, parameterSensitivitydiscountFactor, fxRateconvert, convert, lazy, minimal, noConversionpublic static ImmutableRatesProvider combined(FxRateProvider fx, ImmutableRatesProvider... providers)
If the two providers have curves or time series for the same currency or index,
an IllegalAccessException is thrown.
The FxRateProviders is not populated with the given provider; no attempt is done on merging the embedded FX providers.
fx - the FX provider for the resulting rate providerproviders - the rates providers to be mergedpublic static ImmutableRatesProviderBuilder builder(LocalDate valuationDate)
valuationDate - the valuation datepublic ImmutableRatesProviderBuilder toBuilder()
public ImmutableSet<Currency> getDiscountCurrencies()
BaseProvidergetDiscountCurrencies in interface BaseProviderpublic Stream<Index> indices()
RatesProviderNormally this will only return Ibor, Overnight and Price indices, however it may return other types of index.
indices in interface RatesProviderpublic ImmutableSet<IborIndex> getIborIndices()
RatesProvider
If an index is present in the result of this method, then
RatesProvider.iborIndexRates(IborIndex) should not throw an exception.
getIborIndices in interface RatesProviderpublic ImmutableSet<OvernightIndex> getOvernightIndices()
RatesProvider
If an index is present in the result of this method, then
RatesProvider.overnightIndexRates(OvernightIndex) should not throw an exception.
getOvernightIndices in interface RatesProviderpublic ImmutableSet<PriceIndex> getPriceIndices()
RatesProvider
If an index is present in the result of this method, then
RatesProvider.priceIndexValues(PriceIndex) should not throw an exception.
getPriceIndices in interface RatesProviderpublic ImmutableSet<Index> getTimeSeriesIndices()
RatesProvider
Note that the method RatesProvider.timeSeries(Index) returns an empty time-series
when the index is not known, thus this method is useful to determine if there
actually is a time-series in the underlying data.
getTimeSeriesIndices in interface RatesProviderpublic <T> Optional<T> findData(MarketDataName<T> name)
RatesProvider
This is most commonly used to find a Curve using a CurveName.
If the market data cannot be found, empty is returned.
findData in interface RatesProviderT - the type of the market data valuename - the name to findpublic <T> T data(MarketDataId<T> id)
BaseProviderThis is a general purpose mechanism to obtain market data. In general, it is desirable to pass the specific market data needed for pricing into the pricing method. However, in some cases, notably swaps, this is not feasible. It is strongly recommended to clearly state on pricing methods what data is required.
data in interface BaseProviderT - the type of the valueid - the identifier to findpublic LocalDateDoubleTimeSeries timeSeries(Index index)
RatesProviderThis returns time series for the index.
timeSeries in interface RatesProviderindex - the indexpublic double fxRate(Currency baseCurrency, Currency counterCurrency)
BaseProvider
The rate returned is the rate from the base currency to the counter currency
as defined by this formula: (1 * baseCurrency = fxRate * counterCurrency).
fxRate in interface FxRateProviderfxRate in interface BaseProviderbaseCurrency - the base currency, to convert fromcounterCurrency - the counter currency, to convert topublic DiscountFactors discountFactors(Currency currency)
BaseProviderThe discount factor represents the time value of money for the specified currency when comparing the valuation date to the specified date.
If the valuation date is on or after the specified date, the discount factor is 1.
discountFactors in interface BaseProvidercurrency - the currency to get the discount factors forpublic FxIndexRates fxIndexRates(FxIndex index)
RatesProviderThis returns an object that can provide historic and forward rates for the specified index.
An FX rate is the conversion rate between two currencies. An FX index is the rate as published by a specific organization, typically at a well-known time-of-day.
fxIndexRates in interface RatesProviderindex - the index to find rates forpublic FxForwardRates fxForwardRates(CurrencyPair currencyPair)
RatesProvider
This returns an object that can provide forward rates for the specified currency pair.
See RatesProvider.fxIndexRates(FxIndex) for forward rates with daily fixings.
fxForwardRates in interface RatesProvidercurrencyPair - the currency pair to find forward rates forpublic IborIndexRates iborIndexRates(IborIndex index)
RatesProviderThe rate of the Ibor index, such as 'GBP-LIBOR-3M', varies over time. This returns an object that can provide historic and forward rates for the specified index.
iborIndexRates in interface RatesProviderindex - the index to find rates forpublic OvernightIndexRates overnightIndexRates(OvernightIndex index)
RatesProviderThe rate of the Overnight index, such as 'EUR-EONIA', varies over time. This returns an object that can provide historic and forward rates for the specified index.
overnightIndexRates in interface RatesProviderindex - the index to find rates forpublic PriceIndexValues priceIndexValues(PriceIndex index)
RatesProviderThe value of the Price index, such as 'US-CPI-U', varies over time. This returns an object that can provide historic and forward values for the specified index.
priceIndexValues in interface RatesProviderindex - the index to find values forpublic ImmutableRatesProvider combinedWith(ImmutableRatesProvider other, FxRateProvider fxProvider)
If the two providers have curves or time series for the same currency or index,
an IllegalAccessException is thrown. No attempt is made to combine the
FX providers, instead one is supplied.
other - the other rates providerfxProvider - the FX rate provider to usepublic ImmutableRatesProvider toImmutableRatesProvider()
RatesProviderImmutableRatesProvider.toImmutableRatesProvider in interface RatesProviderpublic Map<CurveName,Curve> getCurves()
No checks are performed to see if one curve name is mapped to two different curves.
public Map<CurveId,Curve> getCurves(CurveGroupName groupName)
No checks are performed to see if one curve name is mapped to two different curves.
This method is useful when transforming a rates provider to MarketData.
groupName - the curve group nameCurveId.public static ImmutableRatesProvider.Meta meta()
ImmutableRatesProvider.public ImmutableRatesProvider.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic LocalDate getValuationDate()
getValuationDate in interface BaseProviderpublic FxRateProvider getFxRateProvider()
public ImmutableMap<Currency,Curve> getDiscountCurves()
public ImmutableMap<Index,Curve> getIndexCurves()
public ImmutableMap<Index,LocalDateDoubleTimeSeries> getTimeSeries()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.