Class VolatilitySwaptionTradePricer
- java.lang.Object
-
- com.opengamma.strata.pricer.swaption.VolatilitySwaptionTradePricer
-
public class VolatilitySwaptionTradePricer extends Object
Pricer for swaptions handling physical and cash par yield settlement based on volatilities.The swap underlying the swaption must have a fixed leg on which the forward rate is computed. The underlying swap must be single currency.
The volatility parameters are not adjusted for the underlying swap convention.
The present value and sensitivities of the premium, if in the future, are also taken into account.
-
-
Field Summary
Fields Modifier and Type Field Description static VolatilitySwaptionTradePricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description VolatilitySwaptionTradePricer(VolatilitySwaptionProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmount
currencyExposure(ResolvedSwaptionTrade trade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Computes the currency exposure of the swaption trade.CurrencyAmount
currentCash(ResolvedSwaptionTrade trade, LocalDate valuationDate)
Calculates the current cash of the swaption trade.double
forwardRate(ResolvedSwaptionTrade swaptionTrade, RatesProvider ratesProvider)
Provides the forward rate.double
impliedVolatility(ResolvedSwaptionTrade swaptionTrade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Computes the implied volatility of the swaption.CurrencyAmount
presentValue(ResolvedSwaptionTrade trade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Calculates the present value of the swaption trade.PointSensitivities
presentValueSensitivityModelParamsVolatility(ResolvedSwaptionTrade trade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Calculates the present value sensitivity to the implied volatility of the swaption trade.PointSensitivities
presentValueSensitivityRatesStickyStrike(ResolvedSwaptionTrade trade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Calculates the present value sensitivity of the swaption to the rate curves.
-
-
-
Field Detail
-
DEFAULT
public static final VolatilitySwaptionTradePricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
VolatilitySwaptionTradePricer
public VolatilitySwaptionTradePricer(VolatilitySwaptionProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.- Parameters:
productPricer
- the pricer forResolvedSwaption
paymentPricer
- the pricer forPayment
-
-
Method Detail
-
presentValue
public CurrencyAmount presentValue(ResolvedSwaptionTrade trade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Calculates the present value of the swaption trade.The result is expressed using the currency of the swaption.
- Parameters:
trade
- the swaption traderatesProvider
- the rates providerswaptionVolatilities
- the volatilities- Returns:
- the present value
-
presentValueSensitivityRatesStickyStrike
public PointSensitivities presentValueSensitivityRatesStickyStrike(ResolvedSwaptionTrade trade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Calculates the present value sensitivity of the swaption to the rate curves.The present value sensitivity is computed in a "sticky strike" style, i.e. the sensitivity to the curve nodes with the volatility at the swaption strike unchanged. This sensitivity does not include a potential change of volatility due to the implicit change of forward rate or moneyness.
- Parameters:
trade
- the swaption traderatesProvider
- the rates providerswaptionVolatilities
- the volatilities- Returns:
- the point sensitivity to the rate curves
-
presentValueSensitivityModelParamsVolatility
public PointSensitivities presentValueSensitivityModelParamsVolatility(ResolvedSwaptionTrade trade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Calculates the present value sensitivity to the implied volatility of the swaption trade.The sensitivity to the implied volatility is also called vega.
- Parameters:
trade
- the swaption traderatesProvider
- the rates providerswaptionVolatilities
- the volatilities- Returns:
- the point sensitivity to the implied volatility
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedSwaptionTrade trade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Computes the currency exposure of the swaption trade.- Parameters:
trade
- the swaption traderatesProvider
- the rates providerswaptionVolatilities
- the volatilities- Returns:
- the currency exposure
-
impliedVolatility
public double impliedVolatility(ResolvedSwaptionTrade swaptionTrade, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
Computes the implied volatility of the swaption.- Parameters:
swaptionTrade
- the swaption traderatesProvider
- the rates providerswaptionVolatilities
- the volatilities- Returns:
- the implied volatility
-
forwardRate
public double forwardRate(ResolvedSwaptionTrade swaptionTrade, RatesProvider ratesProvider)
Provides the forward rate.This is the par rate for the forward starting swap that is the underlying of the swaption.
- Parameters:
swaptionTrade
- the swaption traderatesProvider
- the rates provider- Returns:
- the forward rate
-
currentCash
public CurrencyAmount currentCash(ResolvedSwaptionTrade trade, LocalDate valuationDate)
Calculates the current cash of the swaption trade.Only the premium is contributing to the current cash for non-cash settle swaptions.
- Parameters:
trade
- the swaption tradevaluationDate
- the valuation date- Returns:
- the current cash amount
-
-