public interface FxOptionMarketDataLookup extends CalculationParameter
The FX options market lookup provides access to the volatilities used to price FX options.
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<CurrencyPair> |
getVolatilityCurrencyPairs()
Gets the set of currency pairs that volatilities are provided for.
|
ImmutableSet<MarketDataId<?>> |
getVolatilityIds(CurrencyPair currencyPair)
Gets the identifiers used to obtain the volatilities for the specified currency pair.
|
default FxOptionMarketData |
marketDataView(MarketData marketData)
Obtains a filtered view of the complete set of market data.
|
default FxOptionScenarioMarketData |
marketDataView(ScenarioMarketData marketData)
Obtains a filtered view of the complete set of market data.
|
static FxOptionMarketDataLookup |
of(CurrencyPair currencyPair,
FxOptionVolatilitiesId volatilityId)
Obtains an instance based on a single mapping from currency pair to volatility identifier.
|
static FxOptionMarketDataLookup |
of(Map<CurrencyPair,FxOptionVolatilitiesId> volatilityIds)
Obtains an instance based on a map of volatility identifiers.
|
default Class<? extends CalculationParameter> |
queryType()
Gets the type that the lookup will be queried by.
|
default FunctionRequirements |
requirements(CurrencyPair... currencyPairs)
Creates market data requirements for the specified currency pairs.
|
FunctionRequirements |
requirements(Set<CurrencyPair> currencyPairs)
Creates market data requirements for the specified currency pairs.
|
FxOptionVolatilities |
volatilities(CurrencyPair currencyPair,
MarketData marketData)
Obtains FX options volatilities based on the specified market data.
|
filterstatic FxOptionMarketDataLookup of(CurrencyPair currencyPair, FxOptionVolatilitiesId volatilityId)
The lookup provides volatilities for the specified currency pair.
currencyPair - the currency pairvolatilityId - the volatility identifierstatic FxOptionMarketDataLookup of(Map<CurrencyPair,FxOptionVolatilitiesId> volatilityIds)
The map is used to specify the appropriate volatilities to use for each currency pair.
volatilityIds - the volatility identifiers, keyed by currency pairdefault Class<? extends CalculationParameter> queryType()
This returns FxOptionMarketLookup.class.
When querying parameters using CalculationParameters.findParameter(Class),
FxOptionMarketLookup.class must be passed in to find the instance.
queryType in interface CalculationParameterImmutableSet<CurrencyPair> getVolatilityCurrencyPairs()
ImmutableSet<MarketDataId<?>> getVolatilityIds(CurrencyPair currencyPair)
The result will typically refer to a surface or cube. If the currency pair is not found, an exception is thrown.
currencyPair - the currency pair for which identifiers are requiredIllegalArgumentException - if the currency pair is not founddefault FunctionRequirements requirements(CurrencyPair... currencyPairs)
currencyPairs - the currency pairs, for which volatilities are requiredFunctionRequirements requirements(Set<CurrencyPair> currencyPairs)
currencyPairs - the currency pairs, for which volatilities are requireddefault FxOptionScenarioMarketData 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 FxOptionMarketData 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 scenarioFxOptionVolatilities volatilities(CurrencyPair currencyPair, MarketData marketData)
This provides FxOptionVolatilities suitable for pricing FX options.
Although this method can be used directly, it is typically invoked indirectly
via FxOptionMarketData:
// bind the baseData to this lookup FxOptionMarketData view = lookup.marketDataView(baseData); // pas around FxOptionMarketData within the function to use in pricing FxOptionVolatilities vols = view.volatilities(currencyPair);
currencyPair - the currency pairmarketData - the complete set of market data for one scenarioMarketDataNotFoundException - if the currency pair is not foundCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.