public interface BaseProvider extends FxRateProvider
This provides the valuation date, FX rates and discount factors, Sensitivity for discount factors is also available.
All implementations of this interface must be immutable and thread-safe.
| Modifier and Type | Method and Description |
|---|---|
<T> T |
data(MarketDataId<T> id)
Gets market data of a specific type.
|
default double |
discountFactor(Currency currency,
LocalDate date)
Gets the discount factor applicable for a currency.
|
DiscountFactors |
discountFactors(Currency currency)
Gets the discount factors for a currency.
|
double |
fxRate(Currency baseCurrency,
Currency counterCurrency)
Gets the FX rate for the specified currency pair on the valuation date.
|
default double |
fxRate(CurrencyPair currencyPair)
Gets the FX rate for the specified currency pair on the valuation date.
|
Set<Currency> |
getDiscountCurrencies()
Gets the set of currencies that discount factors are provided for.
|
LocalDate |
getValuationDate()
Gets the valuation date.
|
convert, convert, lazy, minimal, noConversionLocalDate getValuationDate()
The raw data in this provider is calibrated for this date.
Set<Currency> getDiscountCurrencies()
<T> T data(MarketDataId<T> id)
This 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.
T - the type of the valueid - the identifier to findIllegalArgumentException - if the data is not availabledouble fxRate(Currency baseCurrency, Currency counterCurrency)
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 FxRateProviderbaseCurrency - the base currency, to convert fromcounterCurrency - the counter currency, to convert toIllegalArgumentException - if the rate is not availabledefault double fxRate(CurrencyPair currencyPair)
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 FxRateProvidercurrencyPair - the ordered currency pair defining the rate requiredIllegalArgumentException - if the rate is not availableDiscountFactors discountFactors(Currency currency)
The 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.
currency - the currency to get the discount factors forIllegalArgumentException - if the discount factors are not availabledefault double discountFactor(Currency currency, LocalDate date)
The 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.
currency - the currency to get the discount factor fordate - the date to discount toIllegalArgumentException - if the discount factors are not availableCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.