27#ifndef quantlib_swaption_volatility_structure_hpp
28#define quantlib_swaption_volatility_structure_hpp
72 bool extrapolate =
false)
const;
77 bool extrapolate =
false)
const;
82 bool extrapolate =
false)
const;
87 bool extrapolate =
false)
const;
92 bool extrapolate =
false)
const;
97 bool extrapolate =
false)
const;
103 bool extrapolate =
false)
const;
108 bool extrapolate =
false)
const;
113 bool extrapolate =
false)
const;
118 bool extrapolate =
false)
const;
123 bool extrapolate =
false)
const;
128 bool extrapolate =
false)
const;
133 bool extrapolate =
false)
const;
137 bool extrapolate =
false)
const;
141 bool extrapolate =
false)
const;
145 bool extrapolate =
false)
const;
149 bool extrapolate =
false)
const;
153 bool extrapolate =
false)
const;
158 bool extr =
false)
const;
162 bool extr =
false)
const;
166 bool extr =
false)
const;
170 bool extr =
false)
const;
174 bool extr =
false)
const;
178 bool extr =
false)
const;
197 const Date& end)
const;
200 const Date& optionDate,
201 const Period& swapTenor)
const;
210 Rate strike)
const = 0;
212 const Period &swapTenor)
const;
215 bool extrapolate)
const;
217 bool extrapolate)
const;
228 bool extrapolate)
const {
230 return volatility(optionDate, swapTenor, strike, extrapolate);
237 bool extrapolate)
const {
246 bool extrapolate)
const {
248 return blackVariance(optionDate, swapTenor, strike, extrapolate);
255 bool extrapolate)
const {
263 bool extrapolate)
const {
265 return shift(optionDate, swapTenor, extrapolate);
271 bool extrapolate)
const {
276 inline ext::shared_ptr<SmileSection>
279 bool extrapolate)
const {
281 return smileSection(optionDate, swapTenor, extrapolate);
289 bool extrapolate)
const {
292 return v*
v*optionTime;
299 bool extrapolate)
const {
301 return v*
v*optionTime;
308 bool extrapolate)
const {
311 return v*
v*optionTime;
318 bool extrapolate)
const {
320 return v*
v*optionTime;
328 bool extrapolate)
const {
339 bool extrapolate)
const {
351 bool extrapolate)
const {
363 bool extrapolate)
const {
373 bool extrapolate)
const {
382 bool extrapolate)
const {
392 bool extrapolate)
const {
402 bool extrapolate)
const {
408 inline ext::shared_ptr<SmileSection>
411 bool extrapolate)
const {
417 inline ext::shared_ptr<SmileSection>
420 bool extrapolate)
const {
426 inline ext::shared_ptr<SmileSection>
429 bool extrapolate)
const {
436 inline ext::shared_ptr<SmileSection>
439 bool extrapolate)
const {
445 inline ext::shared_ptr<SmileSection>
448 bool extrapolate)
const {
456 inline ext::shared_ptr<SmileSection>
458 const Period& swapT)
const {
474 const Period &swapTenor)
const {
481 "shift parameter only makes sense for lognormal volatilities");
Swaption-volatility structure
ext::shared_ptr< SmileSection > smileSection(const Period &optionTenor, const Period &swapTenor, bool extr=false) const
returns the smile for a given option tenor and swap tenor
virtual const Period & maxSwapTenor() const =0
the largest length for which the term structure can return vols
void checkSwapTenor(const Period &swapTenor, bool extrapolate) const
virtual Real shiftImpl(const Date &optionDate, const Period &swapTenor) const
virtual ext::shared_ptr< SmileSection > smileSectionImpl(Time optionTime, Time swapLength) const =0
virtual ext::shared_ptr< SmileSection > smileSectionImpl(const Date &optionDate, const Period &swapTenor) const
virtual Volatility volatilityImpl(Time optionTime, Time swapLength, Rate strike) const =0
Real shift(const Period &optionTenor, const Period &swapTenor, bool extrapolate=false) const
returns the shift for a given option tenor and swap tenor
Real blackVariance(const Period &optionTenor, const Period &swapTenor, Rate strike, bool extrapolate=false) const
returns the Black variance for a given option tenor and swap tenor
Time swapLength(const Period &swapTenor) const
implements the conversion between swap tenor and swap (time) length
Volatility volatility(const Period &optionTenor, const Period &swapTenor, Rate strike, bool extrapolate=false) const
returns the volatility for a given option tenor and swap tenor
~SwaptionVolatilityStructure() override=default
virtual VolatilityType volatilityType() const
volatility type
virtual Volatility volatilityImpl(const Date &optionDate, const Period &swapTenor, Rate strike) const
Time maxSwapLength() const
the largest swapLength for which the term structure can return vols
virtual Natural settlementDays() const
the settlementDays used for reference date calculation
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual Calendar calendar() const
the calendar used for reference and/or option date calculation
Time timeFromReference(const Date &date) const
date/time conversion
void checkRange(const Date &d, bool extrapolate) const
date-range check
Volatility term structure.
void checkStrike(Rate strike, bool extrapolate) const
strike-range check
Date optionDateFromTenor(const Period &) const
period/date conversion
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
Real Volatility
volatility
ext::shared_ptr< BlackVolTermStructure > v
Volatility term structure.