Interface FxOptionMarketDataLookup
-
- All Superinterfaces:
CalculationParameter
public interface FxOptionMarketDataLookup extends CalculationParameter
The lookup that provides access to FX options volatilities in market data.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 toCalculationRules
. It provides the link between the data that the function needs and the data that is available inScenarioMarketData
.Implementations of this interface must be immutable.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method 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.-
Methods inherited from interface com.opengamma.strata.calc.runner.CalculationParameter
filter
-
-
-
-
Method Detail
-
of
static FxOptionMarketDataLookup of(CurrencyPair currencyPair, FxOptionVolatilitiesId volatilityId)
Obtains an instance based on a single mapping from currency pair to volatility identifier.The lookup provides volatilities for the specified currency pair.
- Parameters:
currencyPair
- the currency pairvolatilityId
- the volatility identifier- Returns:
- the FX options lookup containing the specified mapping
-
of
static FxOptionMarketDataLookup of(Map<CurrencyPair,FxOptionVolatilitiesId> volatilityIds)
Obtains an instance based on a map of volatility identifiers.The map is used to specify the appropriate volatilities to use for each currency pair.
- Parameters:
volatilityIds
- the volatility identifiers, keyed by currency pair- Returns:
- the FX options lookup containing the specified volatilities
-
queryType
default Class<? extends CalculationParameter> queryType()
Gets the type that the lookup will be queried by.This returns
FxOptionMarketLookup.class
. When querying parameters usingCalculationParameters.findParameter(Class)
,FxOptionMarketLookup.class
must be passed in to find the instance.- Specified by:
queryType
in interfaceCalculationParameter
- Returns:
- the type of the parameter implementation
-
getVolatilityCurrencyPairs
ImmutableSet<CurrencyPair> getVolatilityCurrencyPairs()
Gets the set of currency pairs that volatilities are provided for.- Returns:
- the set of currency pairs
-
getVolatilityIds
ImmutableSet<MarketDataId<?>> getVolatilityIds(CurrencyPair currencyPair)
Gets the identifiers used to obtain the volatilities for the specified currency pair.The result will typically refer to a surface or cube. If the currency pair is not found, an exception is thrown.
- Parameters:
currencyPair
- the currency pair for which identifiers are required- Returns:
- the set of market data identifiers
- Throws:
IllegalArgumentException
- if the currency pair is not found
-
requirements
default FunctionRequirements requirements(CurrencyPair... currencyPairs)
Creates market data requirements for the specified currency pairs.- Parameters:
currencyPairs
- the currency pairs, for which volatilities are required- Returns:
- the requirements
-
requirements
FunctionRequirements requirements(Set<CurrencyPair> currencyPairs)
Creates market data requirements for the specified currency pairs.- Parameters:
currencyPairs
- the currency pairs, for which volatilities are required- Returns:
- the requirements
-
marketDataView
default FxOptionScenarioMarketData marketDataView(ScenarioMarketData marketData)
Obtains a filtered view of the complete set of market data.This method returns an instance that binds the lookup to the market data. The input is
ScenarioMarketData
, which contains market data for all scenarios.- Parameters:
marketData
- the complete set of market data for all scenarios- Returns:
- the filtered market data
-
marketDataView
default FxOptionMarketData marketDataView(MarketData marketData)
Obtains a filtered view of the complete set of market data.This method returns an instance that binds the lookup to the market data. The input is
MarketData
, which contains market data for one scenario.- Parameters:
marketData
- the complete set of market data for one scenario- Returns:
- the filtered market data
-
volatilities
FxOptionVolatilities volatilities(CurrencyPair currencyPair, MarketData marketData)
Obtains FX options volatilities based on the specified market data.This provides
FxOptionVolatilities
suitable for pricing FX options. Although this method can be used directly, it is typically invoked indirectly viaFxOptionMarketData
:// 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);
- Parameters:
currencyPair
- the currency pairmarketData
- the complete set of market data for one scenario- Returns:
- the volatilities
- Throws:
MarketDataNotFoundException
- if the currency pair is not found
-
-