Interface BondFutureOptionMarketDataLookup
-
- All Superinterfaces:
CalculationParameter
public interface BondFutureOptionMarketDataLookup extends CalculationParameter
The lookup that provides access to bond future volatilities in market data.The bond future option market lookup provides access to the volatilities used to price bond future 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<MarketDataId<?>>
getVolatilityIds(SecurityId securityId)
Gets the identifiers used to obtain the volatilities for the specified security ID.ImmutableSet<SecurityId>
getVolatilitySecurityIds()
Gets the set of security IDs that volatilities are provided for.default BondFutureOptionMarketData
marketDataView(MarketData marketData)
Obtains a filtered view of the complete set of market data.default BondFutureOptionScenarioMarketData
marketDataView(ScenarioMarketData marketData)
Obtains a filtered view of the complete set of market data.static BondFutureOptionMarketDataLookup
of(SecurityId securityId, BondFutureVolatilitiesId volatilityId)
Obtains an instance based on a single mapping from security ID to volatility identifier.static BondFutureOptionMarketDataLookup
of(Map<SecurityId,BondFutureVolatilitiesId> 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(SecurityId... securityIds)
Creates market data requirements for the specified security IDs.FunctionRequirements
requirements(Set<SecurityId> securityIds)
Creates market data requirements for the specified security IDs.BondFutureVolatilities
volatilities(SecurityId securityId, MarketData marketData)
Obtains bond future volatilities based on the specified market data.-
Methods inherited from interface com.opengamma.strata.calc.runner.CalculationParameter
filter
-
-
-
-
Method Detail
-
of
static BondFutureOptionMarketDataLookup of(SecurityId securityId, BondFutureVolatilitiesId volatilityId)
Obtains an instance based on a single mapping from security ID to volatility identifier.The lookup provides volatilities for the specified security ID.
- Parameters:
securityId
- the security IDvolatilityId
- the volatility identifier- Returns:
- the bond future options lookup containing the specified mapping
-
of
static BondFutureOptionMarketDataLookup of(Map<SecurityId,BondFutureVolatilitiesId> volatilityIds)
Obtains an instance based on a map of volatility identifiers.The map is used to specify the appropriate volatilities to use for each security ID.
- Parameters:
volatilityIds
- the volatility identifiers, keyed by security ID- Returns:
- the bond future options lookup containing the specified volatilities
-
queryType
default Class<? extends CalculationParameter> queryType()
Gets the type that the lookup will be queried by.This returns
BondFutureOptionMarketLookup.class
. When querying parameters usingCalculationParameters.findParameter(Class)
,BondFutureOptionMarketLookup.class
must be passed in to find the instance.- Specified by:
queryType
in interfaceCalculationParameter
- Returns:
- the type of the parameter implementation
-
getVolatilitySecurityIds
ImmutableSet<SecurityId> getVolatilitySecurityIds()
Gets the set of security IDs that volatilities are provided for.- Returns:
- the set of security IDs
-
getVolatilityIds
ImmutableSet<MarketDataId<?>> getVolatilityIds(SecurityId securityId)
Gets the identifiers used to obtain the volatilities for the specified security ID.The result will typically refer to a surface or cube. If the security ID is not found, an exception is thrown.
- Parameters:
securityId
- the security ID for which identifiers are required- Returns:
- the set of market data identifiers
- Throws:
IllegalArgumentException
- if the security ID is not found
-
requirements
default FunctionRequirements requirements(SecurityId... securityIds)
Creates market data requirements for the specified security IDs.- Parameters:
securityIds
- the security IDs, for which volatilities are required- Returns:
- the requirements
-
requirements
FunctionRequirements requirements(Set<SecurityId> securityIds)
Creates market data requirements for the specified security IDs.- Parameters:
securityIds
- the security IDs, for which volatilities are required- Returns:
- the requirements
-
marketDataView
default BondFutureOptionScenarioMarketData 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 BondFutureOptionMarketData 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
BondFutureVolatilities volatilities(SecurityId securityId, MarketData marketData)
Obtains bond future volatilities based on the specified market data.This provides
BondFutureVolatilities
suitable for pricing bond future options. Although this method can be used directly, it is typically invoked indirectly viaBondFutureOptionMarketData
:// bind the baseData to this lookup BondFutureOptionMarketData view = lookup.marketDataView(baseData); // pas around BondFutureOptionMarketData within the function to use in pricing BondFutureVolatilities vols = view.volatilities(securityId);
- Parameters:
securityId
- the security IDmarketData
- the complete set of market data for one scenario- Returns:
- the volatilities
- Throws:
MarketDataNotFoundException
- if the security ID is not found
-
-