Class BlackFxSingleBarrierOptionTradePricer
- java.lang.Object
-
- com.opengamma.strata.pricer.fxopt.BlackFxSingleBarrierOptionTradePricer
-
public class BlackFxSingleBarrierOptionTradePricer extends Object
Pricer for FX barrier option trades in Black-Scholes world.This function provides the ability to price an
ResolvedFxSingleBarrierOptionTrade
.
-
-
Field Summary
Fields Modifier and Type Field Description static BlackFxSingleBarrierOptionTradePricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description BlackFxSingleBarrierOptionTradePricer(BlackFxSingleBarrierOptionProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmount
currencyExposure(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the currency exposure of the FX barrier option trade.CurrencyAmount
currentCash(ResolvedFxSingleBarrierOptionTrade trade, LocalDate valuationDate)
Calculates the current of the FX barrier option trade.FxRate
forwardFxRate(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider)
Calculates the forward exchange rate.double
impliedVolatility(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the implied Black volatility of the FX barrier option trade.MultiCurrencyAmount
presentValue(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value of the FX barrier option trade.PointSensitivities
presentValueSensitivityModelParamsVolatility(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Computes the present value sensitivity to the black volatility used in the pricing.PointSensitivities
presentValueSensitivityRatesStickyStrike(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value sensitivity of the FX barrier option trade.
-
-
-
Field Detail
-
DEFAULT
public static final BlackFxSingleBarrierOptionTradePricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
BlackFxSingleBarrierOptionTradePricer
public BlackFxSingleBarrierOptionTradePricer(BlackFxSingleBarrierOptionProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.- Parameters:
productPricer
- the pricer forResolvedFxSingleBarrierOption
paymentPricer
- the pricer forPayment
-
-
Method Detail
-
presentValue
public MultiCurrencyAmount presentValue(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value of the FX barrier 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(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value sensitivity of the FX barrier 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, i.e., sticky-strike.
- 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(ResolvedFxSingleBarrierOptionTrade 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(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the currency exposure of the FX barrier option trade.- Parameters:
trade
- the option traderatesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the currency exposure
-
currentCash
public CurrencyAmount currentCash(ResolvedFxSingleBarrierOptionTrade trade, LocalDate valuationDate)
Calculates the current of the FX barrier option trade.- Parameters:
trade
- the option tradevaluationDate
- the valuation date- Returns:
- the current cash amount
-
forwardFxRate
public FxRate forwardFxRate(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider)
Calculates the forward exchange rate.- Parameters:
trade
- the option traderatesProvider
- the rates provider- Returns:
- the forward rate
-
impliedVolatility
public double impliedVolatility(ResolvedFxSingleBarrierOptionTrade trade, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the implied Black volatility of the FX barrier 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
-
-