public final class BlackFxOptionSurfaceVolatilities extends Object implements BlackFxOptionVolatilities, org.joda.beans.ImmutableBean, Serializable
The volatility is represented by a surface on the expiry and strike value.
| Modifier and Type | Class and Description |
|---|---|
static class |
BlackFxOptionSurfaceVolatilities.Builder
The bean-builder for
BlackFxOptionSurfaceVolatilities. |
static class |
BlackFxOptionSurfaceVolatilities.Meta
The meta-bean for
BlackFxOptionSurfaceVolatilities. |
| Modifier and Type | Method and Description |
|---|---|
static BlackFxOptionSurfaceVolatilities.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
boolean |
equals(Object obj) |
<T> Optional<T> |
findData(MarketDataName<T> name) |
OptionalInt |
findParameterIndex(ParameterMetadata metadata) |
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) |
Surface |
getSurface()
Gets the Black volatility surface.
|
ZonedDateTime |
getValuationDateTime()
Gets the valuation date-time.
|
int |
hashCode() |
static BlackFxOptionSurfaceVolatilities.Meta |
meta()
The meta-bean for
BlackFxOptionSurfaceVolatilities. |
BlackFxOptionSurfaceVolatilities.Meta |
metaBean() |
static BlackFxOptionSurfaceVolatilities |
of(CurrencyPair currencyPair,
ZonedDateTime valuationDateTime,
Surface surface)
Obtains an instance from the implied volatility surface and the date-time for which it is valid.
|
static BlackFxOptionSurfaceVolatilities |
of(FxOptionVolatilitiesName name,
CurrencyPair currencyPair,
ZonedDateTime valuationDateTime,
Surface surface)
Obtains an instance from the implied volatility surface and the date-time for which it is valid.
|
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.
|
BlackFxOptionSurfaceVolatilities.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
double |
volatility(CurrencyPair currencyPair,
double expiry,
double strike,
double forward)
Calculates the volatility at the specified expiry.
|
BlackFxOptionSurfaceVolatilities |
withParameter(int parameterIndex,
double newValue) |
BlackFxOptionSurfaceVolatilities |
withPerturbation(ParameterPerturbation perturbation) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetVolatilityTypegetValuationDate, parameterSensitivity, volatilitypublic static BlackFxOptionSurfaceVolatilities of(CurrencyPair currencyPair, ZonedDateTime valuationDateTime, Surface surface)
FxOptionVolatilitiesName is built from the name in Surface.
The surface is specified by an instance of Surface, such as InterpolatedNodalSurface.
The surface must contain the correct metadata:
ValueType.YEAR_FRACTION
ValueType.STRIKE
ValueType.BLACK_VOLATILITY
SurfaceInfoType.DAY_COUNT
Surfaces.blackVolatilityByExpiryStrike(String, DayCount).currencyPair - the currency pairvaluationDateTime - the valuation date-timesurface - the volatility surfacepublic static BlackFxOptionSurfaceVolatilities of(FxOptionVolatilitiesName name, CurrencyPair currencyPair, ZonedDateTime valuationDateTime, Surface surface)
The surface is specified by an instance of Surface, such as InterpolatedNodalSurface.
The surface must contain the correct metadata:
ValueType.YEAR_FRACTION
ValueType.STRIKE
ValueType.BLACK_VOLATILITY
SurfaceInfoType.DAY_COUNT
Surfaces.blackVolatilityByExpiryStrike(String, DayCount).name - the namecurrencyPair - the currency pairvaluationDateTime - the valuation date-timesurface - the volatility surfacepublic <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 OptionalInt findParameterIndex(ParameterMetadata metadata)
findParameterIndex in interface ParameterizedDatapublic BlackFxOptionSurfaceVolatilities withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatawithParameter in interface BlackFxOptionVolatilitieswithParameter in interface FxOptionVolatilitiespublic BlackFxOptionSurfaceVolatilities withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatawithPerturbation in interface BlackFxOptionVolatilitieswithPerturbation in interface FxOptionVolatilitiespublic double volatility(CurrencyPair currencyPair, double expiry, double strike, double forward)
FxOptionVolatilities
This relies on expiry supplied by FxOptionVolatilities.relativeTime(ZonedDateTime).
volatility in interface FxOptionVolatilitiescurrencyPair - the currency pairexpiry - 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 BlackFxOptionSurfaceVolatilities.Meta meta()
BlackFxOptionSurfaceVolatilities.public static BlackFxOptionSurfaceVolatilities.Builder builder()
public BlackFxOptionSurfaceVolatilities.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 Surface getSurface()
The x-values represent the expiry year-fraction. The y-values represent the strike. The metadata of the surface must define a day count.
public BlackFxOptionSurfaceVolatilities.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.