Class BlackFxVanillaOptionProductPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.fxopt.BlackFxVanillaOptionProductPricer
-
public class BlackFxVanillaOptionProductPricer extends Object
Pricer for foreign exchange vanilla option transaction products with a lognormal model.This function provides the ability to price an
ResolvedFxVanillaOption
.All of the computation is be based on the counter currency of the underlying FX transaction. For example, price, PV and risk measures of the product will be expressed in USD for an option on EUR/USD.
-
-
Field Summary
Fields Modifier and Type Field Description static BlackFxVanillaOptionProductPricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description BlackFxVanillaOptionProductPricer(DiscountingFxSingleProductPricer fxPricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmount
currencyExposure(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the currency exposure of the foreign exchange vanilla option product.double
delta(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the delta of the foreign exchange vanilla option product.FxRate
forwardFxRate(ResolvedFxVanillaOption option, RatesProvider ratesProvider)
Calculates the forward exchange rate.double
gamma(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the gamma of the foreign exchange vanilla option product.double
impliedVolatility(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the implied Black volatility of the foreign exchange vanilla option product.CurrencyAmount
presentValue(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value of the foreign exchange vanilla option product.CurrencyAmount
presentValueDelta(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value delta of the foreign exchange vanilla option product.CurrencyAmount
presentValueGamma(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value delta of the foreign exchange vanilla option product.PointSensitivityBuilder
presentValueSensitivityModelParamsVolatility(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Computes the present value sensitivity to the black volatility used in the pricing.PointSensitivities
presentValueSensitivityRatesStickyStrike(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value sensitivity of the foreign exchange vanilla option product.CurrencyAmount
presentValueTheta(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value theta of the foreign exchange vanilla option product.CurrencyAmount
presentValueVega(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value vega of the foreign exchange vanilla option product.double
price(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the price of the foreign exchange vanilla option product.double
theta(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the Black theta of the foreign exchange vanilla option product.double
vega(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the vega of the foreign exchange vanilla option product.
-
-
-
Field Detail
-
DEFAULT
public static final BlackFxVanillaOptionProductPricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
BlackFxVanillaOptionProductPricer
public BlackFxVanillaOptionProductPricer(DiscountingFxSingleProductPricer fxPricer)
Creates an instance.- Parameters:
fxPricer
- the pricer forResolvedFxSingle
-
-
Method Detail
-
price
public double price(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the price of the foreign exchange vanilla option product.The price of the product is the value on the valuation date for one unit of the base currency and is expressed in the counter currency. The price does not take into account the long/short flag. See
presentValue(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
for scaling and currency.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the price of the product
-
presentValue
public CurrencyAmount presentValue(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value of the foreign exchange vanilla option product.The present value of the product is the value on the valuation date. It is expressed in the counter currency.
- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value of the product
-
delta
public double delta(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the delta of the foreign exchange vanilla option product.The delta is the first derivative of
price(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
with respect to spot.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the delta of the product
-
presentValueDelta
public CurrencyAmount presentValueDelta(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value delta of the foreign exchange vanilla option product.The present value delta is the first derivative of
presentValue(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
with respect to spot.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value delta of the product
-
presentValueSensitivityRatesStickyStrike
public PointSensitivities presentValueSensitivityRatesStickyStrike(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value sensitivity of the foreign exchange vanilla option product.The present value sensitivity of the product is the sensitivity of
presentValue(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
to the underlying curves.The volatility is fixed in this sensitivity computation.
- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value curve sensitivity of the product
-
gamma
public double gamma(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the gamma of the foreign exchange vanilla option product.The gamma is the second derivative of
price(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
with respect to spot.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the gamma of the product
-
presentValueGamma
public CurrencyAmount presentValueGamma(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value delta of the foreign exchange vanilla option product.The present value gamma is the second derivative of the
presentValue(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
with respect to spot.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value gamma of the product
-
vega
public double vega(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the vega of the foreign exchange vanilla option product.The vega is the first derivative of
price(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
with respect to volatility.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the vega of the product
-
presentValueVega
public CurrencyAmount presentValueVega(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value vega of the foreign exchange vanilla option product.The present value vega is the first derivative of the
presentValue(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
with respect to volatility.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value vega of the product
-
presentValueSensitivityModelParamsVolatility
public PointSensitivityBuilder presentValueSensitivityModelParamsVolatility(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Computes the present value sensitivity to the black volatility used in the pricing.The result is a single sensitivity to the volatility used.
- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value sensitivity
-
theta
public double theta(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the Black theta of the foreign exchange vanilla option product.The theta is the negative of the first derivative of
price(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
with respect to time parameter in Black formula (the discounted driftless theta).- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the theta of the product
-
presentValueTheta
public CurrencyAmount presentValueTheta(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value theta of the foreign exchange vanilla option product.The present value theta is the negative of the first derivative of
presentValue(com.opengamma.strata.product.fxopt.ResolvedFxVanillaOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
with time parameter in Black formula, i.e., the driftless theta of the present value.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value vega of the product
-
forwardFxRate
public FxRate forwardFxRate(ResolvedFxVanillaOption option, RatesProvider ratesProvider)
Calculates the forward exchange rate.- Parameters:
option
- the option productratesProvider
- the rates provider- Returns:
- the forward rate
-
impliedVolatility
public double impliedVolatility(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the implied Black volatility of the foreign exchange vanilla option product.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the implied volatility of the product
- Throws:
IllegalArgumentException
- if the option has expired
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFxVanillaOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the currency exposure of the foreign exchange vanilla option product.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the currency exposure
-
-