public interface FxOptionVolatilities extends MarketDataView, ParameterizedData
This provides access to the volatilities for pricing models, such as Black.
| Modifier and Type | Method and Description |
|---|---|
ValueDerivatives |
firstPartialDerivatives(CurrencyPair currencyPair,
double expiry,
double strike,
double forward)
Computes the partial derivatives of the volatilities.
|
CurrencyPair |
getCurrencyPair()
Gets the currency pair for which the data is valid.
|
FxOptionVolatilitiesName |
getName()
Gets the name of these volatilities.
|
default LocalDate |
getValuationDate()
Gets the valuation date.
|
ZonedDateTime |
getValuationDateTime()
Gets the valuation date-time.
|
ValueType |
getVolatilityType()
Gets the type of volatility returned by the
volatility(com.opengamma.strata.basics.currency.CurrencyPair, java.time.ZonedDateTime, double, double) method. |
CurrencyParameterSensitivities |
parameterSensitivity(PointSensitivities pointSensitivities)
Calculates the parameter sensitivity.
|
default CurrencyParameterSensitivities |
parameterSensitivity(PointSensitivity... pointSensitivities)
Calculates the parameter sensitivity.
|
double |
price(double expiry,
PutCall putCall,
double strike,
double forward,
double volatility)
Calculates the price.
|
double |
relativeTime(ZonedDateTime dateTime)
Converts a time and date to a relative year fraction.
|
double |
volatility(CurrencyPair currencyPair,
double expiry,
double strike,
double forward)
Calculates the volatility at the specified expiry.
|
default double |
volatility(CurrencyPair currencyPair,
ZonedDateTime expiryDateTime,
double strike,
double forward)
Calculates the volatility at the specified expiry.
|
FxOptionVolatilities |
withParameter(int parameterIndex,
double newValue) |
FxOptionVolatilities |
withPerturbation(ParameterPerturbation perturbation) |
findDatafindParameterIndex, getParameter, getParameterCount, getParameterMetadataFxOptionVolatilitiesName getName()
CurrencyPair getCurrencyPair()
ValueType getVolatilityType()
volatility(com.opengamma.strata.basics.currency.CurrencyPair, java.time.ZonedDateTime, double, double) method.default LocalDate getValuationDate()
The volatilities are calibrated for this date.
getValuationDate in interface MarketDataViewZonedDateTime getValuationDateTime()
The volatilities are calibrated for this date-time.
FxOptionVolatilities withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDataFxOptionVolatilities withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatadefault double volatility(CurrencyPair currencyPair, ZonedDateTime expiryDateTime, double strike, double forward)
currencyPair - the currency pairexpiryDateTime - the option expirystrike - the option strike rateforward - the forward ratedouble volatility(CurrencyPair currencyPair, double expiry, double strike, double forward)
This relies on expiry supplied by relativeTime(ZonedDateTime).
currencyPair - the currency pairexpiry - the time to expiry as a year fractionstrike - the option strike rateforward - the forward ratedefault CurrencyParameterSensitivities parameterSensitivity(PointSensitivity... pointSensitivities)
This computes the CurrencyParameterSensitivities associated with the PointSensitivities.
This corresponds to the projection of the point sensitivity to the internal parameters representation.
pointSensitivities - the point sensitivitiesCurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities)
This computes the CurrencyParameterSensitivities associated with the PointSensitivities.
This corresponds to the projection of the point sensitivity to the internal parameters representation.
pointSensitivities - the point sensitivitiesValueDerivatives firstPartialDerivatives(CurrencyPair currencyPair, double expiry, double strike, double forward)
The first derivatives are dVol/dExpiry and dVol/dStrike.
The derivatives are in the following order:
currencyPair - the currency pairexpiry - the expiry at which the partial derivative is takenstrike - the strike at which the partial derivative is takenforward - the forward rateRuntimeException - if the derivative cannot be calculateddouble price(double expiry,
PutCall putCall,
double strike,
double forward,
double volatility)
This relies on expiry supplied by relativeTime(ZonedDateTime).
This relies on volatility supplied by volatility(CurrencyPair, double, double, double).
expiry - the time to expiry as a year fractionputCall - whether the option is put or callstrike - the option strike rateforward - the forward ratevolatility - the volatilityRuntimeException - if the value cannot be obtaineddouble relativeTime(ZonedDateTime dateTime)
When the date is after the valuation date (and potentially time), the returned number is negative.
dateTime - the date-time to find the relative year fraction ofCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.