public interface SwaptionMarketDataLookup extends CalculationParameter
The swaption market lookup provides access to the volatilities used to price swaptions.
The lookup implements CalculationParameter and is used by passing it
as an argument to CalculationRules. It provides the link between the
data that the function needs and the data that is available in ScenarioMarketData.
Implementations of this interface must be immutable.
| Modifier and Type | Method and Description |
|---|---|
ImmutableSet<MarketDataId<?>> |
getVolatilityIds(RateIndex index)
Gets the identifiers used to obtain the volatilities for the specified currency.
|
ImmutableSet<RateIndex> |
getVolatilityIndices()
Gets the set of indices that volatilities are provided for.
|
default SwaptionMarketData |
marketDataView(MarketData marketData)
Obtains a filtered view of the complete set of market data.
|
default SwaptionScenarioMarketData |
marketDataView(ScenarioMarketData marketData)
Obtains a filtered view of the complete set of market data.
|
static SwaptionMarketDataLookup |
of(Map<RateIndex,SwaptionVolatilitiesId> volatilityIds)
Obtains an instance based on a map of volatility identifiers.
|
static SwaptionMarketDataLookup |
of(RateIndex index,
SwaptionVolatilitiesId volatilityId)
Obtains an instance based on a single mapping from index to volatility identifier.
|
default Class<? extends CalculationParameter> |
queryType()
Gets the type that the lookup will be queried by.
|
default FunctionRequirements |
requirements(RateIndex... indices)
Creates market data requirements for the specified indices.
|
FunctionRequirements |
requirements(Set<RateIndex> indices)
Creates market data requirements for the specified indices.
|
SwaptionVolatilities |
volatilities(RateIndex index,
MarketData marketData)
Obtains swaption volatilities based on the specified market data.
|
filterstatic SwaptionMarketDataLookup of(RateIndex index, SwaptionVolatilitiesId volatilityId)
The lookup provides volatilities for the specified index.
index - the indexvolatilityId - the volatility identifierstatic SwaptionMarketDataLookup of(Map<RateIndex,SwaptionVolatilitiesId> volatilityIds)
The map is used to specify the appropriate volatilities to use for each index.
volatilityIds - the volatility identifiers, keyed by indexdefault Class<? extends CalculationParameter> queryType()
This returns SwaptionMarketLookup.class.
When querying parameters using CalculationParameters.findParameter(Class),
SwaptionMarketLookup.class must be passed in to find the instance.
queryType in interface CalculationParameterImmutableSet<RateIndex> getVolatilityIndices()
ImmutableSet<MarketDataId<?>> getVolatilityIds(RateIndex index)
The result will typically refer to a surface or cube. If the index is not found, an exception is thrown.
index - the index for which identifiers are requiredIllegalArgumentException - if the index is not founddefault FunctionRequirements requirements(RateIndex... indices)
indices - the indices, for which volatilities are requiredFunctionRequirements requirements(Set<RateIndex> indices)
indices - the indices, for which volatilities are requireddefault SwaptionScenarioMarketData marketDataView(ScenarioMarketData marketData)
This method returns an instance that binds the lookup to the market data.
The input is ScenarioMarketData, which contains market data for all scenarios.
marketData - the complete set of market data for all scenariosdefault SwaptionMarketData marketDataView(MarketData marketData)
This method returns an instance that binds the lookup to the market data.
The input is MarketData, which contains market data for one scenario.
marketData - the complete set of market data for one scenarioSwaptionVolatilities volatilities(RateIndex index, MarketData marketData)
This provides SwaptionVolatilities suitable for pricing a swaption.
Although this method can be used directly, it is typically invoked indirectly
via SwaptionMarketData:
// bind the baseData to this lookup SwaptionMarketData view = lookup.marketDataView(baseData); // pass around SwaptionMarketData within the function to use in pricing SwaptionVolatilities vols = view.volatilities(index);
index - the indexmarketData - the complete set of market data for one scenarioMarketDataNotFoundException - if the index is not foundCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.