public final class BlackFxOptionSmileVolatilities extends Object implements BlackFxOptionVolatilities, org.joda.beans.ImmutableBean, Serializable
The volatility is represented by a term structure of interpolated smile,
SmileDeltaTermStructure, which represents expiry dependent smile formed of
ATM, risk reversal and strangle as used in FX market.
| Modifier and Type | Class and Description |
|---|---|
static class |
BlackFxOptionSmileVolatilities.Builder
The bean-builder for
BlackFxOptionSmileVolatilities. |
static class |
BlackFxOptionSmileVolatilities.Meta
The meta-bean for
BlackFxOptionSmileVolatilities. |
| Modifier and Type | Method and Description |
|---|---|
static BlackFxOptionSmileVolatilities.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
boolean |
equals(Object obj) |
<T> Optional<T> |
findData(MarketDataName<T> name) |
ValueDerivatives |
firstPartialDerivatives(CurrencyPair currencyPair,
double expiry,
double strike,
double forward)
Computes the partial derivatives of the volatilities.
|
CurrencyPair |
getCurrencyPair()
Gets the currency pair that the volatilities are for.
|
FxOptionVolatilitiesName |
getName()
Gets the name of the volatilities.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
SmileDeltaTermStructure |
getSmile()
Gets the volatility model.
|
ZonedDateTime |
getValuationDateTime()
Gets the valuation date-time.
|
int |
hashCode() |
static BlackFxOptionSmileVolatilities.Meta |
meta()
The meta-bean for
BlackFxOptionSmileVolatilities. |
BlackFxOptionSmileVolatilities.Meta |
metaBean() |
static BlackFxOptionSmileVolatilities |
of(FxOptionVolatilitiesName name,
CurrencyPair currencyPair,
ZonedDateTime valuationTime,
SmileDeltaTermStructure smile)
Obtains an instance based on a smile.
|
CurrencyParameterSensitivities |
parameterSensitivity(PointSensitivities 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.
|
BlackFxOptionSmileVolatilities.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
double |
volatility(CurrencyPair currencyPair,
double expiryTime,
double strike,
double forward)
Calculates the volatility at the specified expiry.
|
BlackFxOptionSmileVolatilities |
withParameter(int parameterIndex,
double newValue) |
BlackFxOptionSmileVolatilities |
withPerturbation(ParameterPerturbation perturbation) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetVolatilityTypegetValuationDate, parameterSensitivity, volatilityfindParameterIndexpublic static BlackFxOptionSmileVolatilities of(FxOptionVolatilitiesName name, CurrencyPair currencyPair, ZonedDateTime valuationTime, SmileDeltaTermStructure smile)
name - the name of the volatilitiescurrencyPair - the currency pairvaluationTime - the valuation date-timesmile - the term structure of smilepublic <T> Optional<T> findData(MarketDataName<T> name)
findData in interface MarketDataViewpublic int getParameterCount()
getParameterCount in interface ParameterizedDatapublic double getParameter(int parameterIndex)
getParameter in interface ParameterizedDatapublic ParameterMetadata getParameterMetadata(int parameterIndex)
getParameterMetadata in interface ParameterizedDatapublic BlackFxOptionSmileVolatilities withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatawithParameter in interface BlackFxOptionVolatilitieswithParameter in interface FxOptionVolatilitiespublic BlackFxOptionSmileVolatilities withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatawithPerturbation in interface BlackFxOptionVolatilitieswithPerturbation in interface FxOptionVolatilitiespublic double volatility(CurrencyPair currencyPair, double expiryTime, double strike, double forward)
FxOptionVolatilities
This relies on expiry supplied by FxOptionVolatilities.relativeTime(ZonedDateTime).
volatility in interface FxOptionVolatilitiescurrencyPair - the currency pairexpiryTime - the time to expiry as a year fractionstrike - the option strike rateforward - the forward ratepublic CurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities)
FxOptionVolatilities
This computes the CurrencyParameterSensitivities associated with the PointSensitivities.
This corresponds to the projection of the point sensitivity to the internal parameters representation.
parameterSensitivity in interface FxOptionVolatilitiespointSensitivities - the point sensitivitiespublic ValueDerivatives firstPartialDerivatives(CurrencyPair currencyPair, double expiry, double strike, double forward)
FxOptionVolatilities
The first derivatives are dVol/dExpiry and dVol/dStrike.
The derivatives are in the following order:
firstPartialDerivatives in interface FxOptionVolatilitiescurrencyPair - the currency pairexpiry - the expiry at which the partial derivative is takenstrike - the strike at which the partial derivative is takenforward - the forward ratepublic double price(double expiry,
PutCall putCall,
double strike,
double forward,
double volatility)
FxOptionVolatilities
This relies on expiry supplied by FxOptionVolatilities.relativeTime(ZonedDateTime).
This relies on volatility supplied by FxOptionVolatilities.volatility(CurrencyPair, double, double, double).
price in interface FxOptionVolatilitiesexpiry - the time to expiry as a year fractionputCall - whether the option is put or callstrike - the option strike rateforward - the forward ratevolatility - the volatilitypublic double relativeTime(ZonedDateTime dateTime)
FxOptionVolatilitiesWhen the date is after the valuation date (and potentially time), the returned number is negative.
relativeTime in interface FxOptionVolatilitiesdateTime - the date-time to find the relative year fraction ofpublic static BlackFxOptionSmileVolatilities.Meta meta()
BlackFxOptionSmileVolatilities.public static BlackFxOptionSmileVolatilities.Builder builder()
public BlackFxOptionSmileVolatilities.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic FxOptionVolatilitiesName getName()
getName in interface FxOptionVolatilitiespublic CurrencyPair getCurrencyPair()
getCurrencyPair in interface FxOptionVolatilitiespublic ZonedDateTime getValuationDateTime()
getValuationDateTime in interface FxOptionVolatilitiespublic SmileDeltaTermStructure getSmile()
This represents expiry dependent smile which consists of ATM, risk reversal and strangle as used in FX market.
public BlackFxOptionSmileVolatilities.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.