public class VolatilitySwaptionCashParYieldProductPricer extends Object
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 value of the swaption after expiry is 0.
For a swaption which already expired, negative number is returned by
SwaptionVolatilities.relativeTime(ZonedDateTime).
| Modifier and Type | Field and Description |
|---|---|
static VolatilitySwaptionCashParYieldProductPricer |
DEFAULT
Default implementation.
|
| Constructor and Description |
|---|
VolatilitySwaptionCashParYieldProductPricer(DiscountingSwapProductPricer swapPricer)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
calculateNumeraire(ResolvedSwaption swaption,
ResolvedSwapLeg fixedLeg,
double forward,
RatesProvider ratesProvider)
Calculates the numeraire, used to multiply the results.
|
protected double |
calculateStrike(ResolvedSwapLeg fixedLeg)
Calculates the strike.
|
MultiCurrencyAmount |
currencyExposure(ResolvedSwaption swaption,
RatesProvider ratesProvider,
SwaptionVolatilities swaptionVolatilities)
Computes the currency exposure of the swaption.
|
protected ResolvedSwapLeg |
fixedLeg(ResolvedSwap swap)
Checks that there is exactly one fixed leg and returns it.
|
double |
forwardRate(ResolvedSwaption swaption,
RatesProvider ratesProvider)
Provides the forward rate.
|
protected DiscountingSwapProductPricer |
getSwapPricer()
Gets the swap pricer.
|
double |
impliedVolatility(ResolvedSwaption swaption,
RatesProvider ratesProvider,
SwaptionVolatilities swaptionVolatilities)
Computes the implied volatility of the swaption.
|
CurrencyAmount |
presentValue(ResolvedSwaption swaption,
RatesProvider ratesProvider,
SwaptionVolatilities swaptionVolatilities)
Calculates the present value of the swaption.
|
CurrencyAmount |
presentValueDelta(ResolvedSwaption swaption,
RatesProvider ratesProvider,
SwaptionVolatilities swaptionVolatilities)
Calculates the present value delta of the swaption.
|
CurrencyAmount |
presentValueGamma(ResolvedSwaption swaption,
RatesProvider ratesProvider,
SwaptionVolatilities swaptionVolatilities)
Calculates the present value gamma of the swaption.
|
SwaptionSensitivity |
presentValueSensitivityModelParamsVolatility(ResolvedSwaption swaption,
RatesProvider ratesProvider,
SwaptionVolatilities swaptionVolatilities)
Calculates the present value sensitivity to the implied volatility of the swaption.
|
PointSensitivityBuilder |
presentValueSensitivityRatesStickyStrike(ResolvedSwaption swaption,
RatesProvider ratesProvider,
SwaptionVolatilities swaptionVolatilities)
Calculates the present value sensitivity of the swaption to the rate curves.
|
CurrencyAmount |
presentValueTheta(ResolvedSwaption swaption,
RatesProvider ratesProvider,
SwaptionVolatilities swaptionVolatilities)
Calculates the present value of the swaption.
|
protected void |
validate(ResolvedSwaption swaption,
RatesProvider ratesProvider,
SwaptionVolatilities swaptionVolatilities)
Validates that the rates and volatilities providers are coherent
and that the swaption is single currency cash par-yield.
|
protected void |
validateSwaption(ResolvedSwaption swaption)
Validates that the swaption is single currency cash par-yield.
|
public static final VolatilitySwaptionCashParYieldProductPricer DEFAULT
public VolatilitySwaptionCashParYieldProductPricer(DiscountingSwapProductPricer swapPricer)
swapPricer - the pricer for Swapprotected DiscountingSwapProductPricer getSwapPricer()
public CurrencyAmount presentValue(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
The result is expressed using the currency of the swaption.
swaption - the swaptionratesProvider - the rates providerswaptionVolatilities - the volatilitiespublic MultiCurrencyAmount currencyExposure(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
This is equivalent to the present value of the swaption.
swaption - the swaptionratesProvider - the rates providerswaptionVolatilities - the volatilitiespublic double impliedVolatility(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
swaption - the swaptionratesProvider - the rates providerswaptionVolatilities - the volatilitiespublic double forwardRate(ResolvedSwaption swaption, RatesProvider ratesProvider)
This is the par rate for the forward starting swap that is the underlying of the swaption.
swaption - the swaptionratesProvider - the rates providerpublic CurrencyAmount presentValueDelta(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
The present value delta is given by pvbp * priceDelta where priceDelta
is the first derivative of the price with respect to forward.
The result is expressed using the currency of the swaption.
swaption - the swaptionratesProvider - the rates providerswaptionVolatilities - the volatilitiespublic CurrencyAmount presentValueGamma(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
The present value gamma is given by pvbp * priceGamma where priceGamma
is the second derivative of the price with respect to forward.
The result is expressed using the currency of the swaption.
swaption - the swaptionratesProvider - the rates providerswaptionVolatilities - the volatilitiespublic CurrencyAmount presentValueTheta(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
The present value theta is given by pvbp * priceTheta where priceTheta
is the minus of the price sensitivity to timeToExpiry.
The result is expressed using the currency of the swaption.
swaption - the swaptionratesProvider - the rates providerswaptionVolatilities - the volatilitiespublic PointSensitivityBuilder presentValueSensitivityRatesStickyStrike(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
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.
swaption - the swaptionratesProvider - the rates providerswaptionVolatilities - the volatilitiespublic SwaptionSensitivity presentValueSensitivityModelParamsVolatility(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
The sensitivity to the implied volatility is also called vega.
swaption - the swaptionratesProvider - the rates providerswaptionVolatilities - the volatilitiesprotected double calculateNumeraire(ResolvedSwaption swaption, ResolvedSwapLeg fixedLeg, double forward, RatesProvider ratesProvider)
swaption - the swapfixedLeg - the fixed legforward - the forward rateratesProvider - the rates providerprotected double calculateStrike(ResolvedSwapLeg fixedLeg)
fixedLeg - the fixed legprotected ResolvedSwapLeg fixedLeg(ResolvedSwap swap)
swap - the swapprotected void validate(ResolvedSwaption swaption, RatesProvider ratesProvider, SwaptionVolatilities swaptionVolatilities)
swaption - the swaptionratesProvider - the rates providerswaptionVolatilities - the volatilitiesprotected void validateSwaption(ResolvedSwaption swaption)
swaption - the swaptionCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.