Class BlackFxVanillaOptionTradePricer
- java.lang.Object
-
- com.opengamma.strata.pricer.fxopt.BlackFxVanillaOptionTradePricer
-
public class BlackFxVanillaOptionTradePricer extends Object
Pricer for FX vanilla option trades with a lognormal model.This function provides the ability to price an
FxVanillaOptionTrade
.
-
-
Field Summary
Fields Modifier and Type Field Description static BlackFxVanillaOptionTradePricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description BlackFxVanillaOptionTradePricer(BlackFxVanillaOptionProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmount
currencyExposure(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the currency exposure of the FX vanilla option trade.CurrencyAmount
currentCash(ResolvedFxVanillaOptionTrade trade, LocalDate valuationDate)
Calculates the current of the FX vanilla option trade.FxRate
forwardFxRate(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider)
Calculates the forward exchange rate.double
impliedVolatility(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the implied Black volatility of the foreign exchange vanilla option trade.MultiCurrencyAmount
presentValue(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value of the FX vanilla option trade.PointSensitivities
presentValueSensitivityModelParamsVolatility(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Computes the present value sensitivity to the black volatility used in the pricing.PointSensitivities
presentValueSensitivityRatesStickyStrike(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value sensitivity of the FX vanilla option trade.
-
-
-
Field Detail
-
DEFAULT
public static final BlackFxVanillaOptionTradePricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
BlackFxVanillaOptionTradePricer
public BlackFxVanillaOptionTradePricer(BlackFxVanillaOptionProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.- Parameters:
productPricer
- the pricer forResolvedFxVanillaOption
paymentPricer
- the pricer forPayment
-
-
Method Detail
-
presentValue
public MultiCurrencyAmount presentValue(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value of the FX vanilla option trade.The present value of the trade is the value on the valuation date.
- Parameters:
trade
- the option traderatesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value of the trade
-
presentValueSensitivityRatesStickyStrike
public PointSensitivities presentValueSensitivityRatesStickyStrike(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value sensitivity of the FX vanilla option trade.The present value sensitivity of the trade is the sensitivity of the present value to the underlying curves.
The volatility is fixed in this sensitivity computation.
- Parameters:
trade
- the option traderatesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value curve sensitivity of the trade
-
presentValueSensitivityModelParamsVolatility
public PointSensitivities presentValueSensitivityModelParamsVolatility(ResolvedFxVanillaOptionTrade trade, 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:
trade
- the option traderatesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value sensitivity
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the currency exposure of the FX vanilla option trade.- Parameters:
trade
- the option traderatesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the currency exposure
-
currentCash
public CurrencyAmount currentCash(ResolvedFxVanillaOptionTrade trade, LocalDate valuationDate)
Calculates the current of the FX vanilla option trade.- Parameters:
trade
- the option tradevaluationDate
- the valuation date- Returns:
- the current cash amount
-
forwardFxRate
public FxRate forwardFxRate(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider)
Calculates the forward exchange rate.- Parameters:
trade
- the option traderatesProvider
- the rates provider- Returns:
- the forward rate
-
impliedVolatility
public double impliedVolatility(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the implied Black volatility of the foreign exchange vanilla option trade.- Parameters:
trade
- the option traderatesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the implied volatility of the product
- Throws:
IllegalArgumentException
- if the option has expired
-
-