public final class BlackFxOptionFlatVolatilities extends Object implements BlackFxOptionVolatilities, org.joda.beans.ImmutableBean, Serializable
The volatility is represented by a curve on the expiry and the volatility is flat along the strike direction.
| Modifier and Type | Class and Description |
|---|---|
static class |
BlackFxOptionFlatVolatilities.Builder
The bean-builder for
BlackFxOptionFlatVolatilities. |
static class |
BlackFxOptionFlatVolatilities.Meta
The meta-bean for
BlackFxOptionFlatVolatilities. |
| Modifier and Type | Method and Description |
|---|---|
static BlackFxOptionFlatVolatilities.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.
|
Curve |
getCurve()
Gets the Black volatility curve.
|
FxOptionVolatilitiesName |
getName()
Gets the name of these volatilities.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
ZonedDateTime |
getValuationDateTime()
Gets the valuation date-time.
|
int |
hashCode() |
static BlackFxOptionFlatVolatilities.Meta |
meta()
The meta-bean for
BlackFxOptionFlatVolatilities. |
BlackFxOptionFlatVolatilities.Meta |
metaBean() |
static BlackFxOptionFlatVolatilities |
of(CurrencyPair currencyPair,
ZonedDateTime valuationDateTime,
Curve curve)
Obtains an instance from an expiry-volatility curve 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.
|
BlackFxOptionFlatVolatilities.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.
|
BlackFxOptionFlatVolatilities |
withParameter(int parameterIndex,
double newValue) |
BlackFxOptionFlatVolatilities |
withPerturbation(ParameterPerturbation perturbation) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetVolatilityTypegetValuationDate, parameterSensitivity, volatilitypublic static BlackFxOptionFlatVolatilities of(CurrencyPair currencyPair, ZonedDateTime valuationDateTime, Curve curve)
The curve is specified by an instance of Curve, such as InterpolatedNodalCurve.
The curve must contain the correct metadata:
ValueType.YEAR_FRACTION
ValueType.BLACK_VOLATILITY
CurveInfoType.DAY_COUNT
Curves.blackVolatilityByExpiry(String, DayCount).currencyPair - the currency pairvaluationDateTime - the valuation date-timecurve - the volatility curvepublic FxOptionVolatilitiesName getName()
FxOptionVolatilitiesgetName in interface FxOptionVolatilitiespublic <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 BlackFxOptionFlatVolatilities withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatawithParameter in interface BlackFxOptionVolatilitieswithParameter in interface FxOptionVolatilitiespublic BlackFxOptionFlatVolatilities 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 BlackFxOptionFlatVolatilities.Meta meta()
BlackFxOptionFlatVolatilities.public static BlackFxOptionFlatVolatilities.Builder builder()
public BlackFxOptionFlatVolatilities.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic CurrencyPair getCurrencyPair()
getCurrencyPair in interface FxOptionVolatilitiespublic ZonedDateTime getValuationDateTime()
getValuationDateTime in interface FxOptionVolatilitiespublic Curve getCurve()
The x-values represent the expiry year-fraction. The metadata of the curve must define a day count.
public BlackFxOptionFlatVolatilities.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.