Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SwaptionVolCubeWithATM Class Reference

Wrapper class for a SwaptionVolatilityCube that easily and efficiently exposes ATM vols. More...

#include <qle/termstructures/swaptionvolcubewithatm.hpp>

+ Inheritance diagram for SwaptionVolCubeWithATM:
+ Collaboration diagram for SwaptionVolCubeWithATM:

Public Member Functions

 SwaptionVolCubeWithATM (const QuantLib::ext::shared_ptr< SwaptionVolatilityCube > &cube)
 
TermStructure interface
DayCounter dayCounter () const override
 
Date maxDate () const override
 
Time maxTime () const override
 
const Date & referenceDate () const override
 
Calendar calendar () const override
 
Natural settlementDays () const override
 
VolatilityTermStructure interface
Rate minStrike () const override
 
Rate maxStrike () const override
 

SwaptionVolatilityStructure interface

QuantLib::ext::shared_ptr< SwaptionVolatilityCubecube_
 
const Period & maxSwapTenor () const override
 
VolatilityType volatilityType () const override
 
QuantLib::ext::shared_ptr< SwaptionVolatilityCubecube () const
 
QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl (Time optionTime, Time swapLength) const override
 
Volatility volatilityImpl (Time optionTime, Time swapLength, Rate strike) const override
 
Real shiftImpl (Time optionTime, Time swapLength) const override
 

Detailed Description

Wrapper class for a SwaptionVolatilityCube that easily and efficiently exposes ATM vols.

This class implements SwaptionVolatilityStructure and takes a cube as an input. If asked for a volatility with strike=Null<Real>() it will return the ATM vol by asking the ATM surface directly. If asked for any other strike it will pass it on to the cube.

There is no calculation of ATM in this class.

Definition at line 43 of file swaptionvolcubewithatm.hpp.

Constructor & Destructor Documentation

◆ SwaptionVolCubeWithATM()

SwaptionVolCubeWithATM ( const QuantLib::ext::shared_ptr< SwaptionVolatilityCube > &  cube)

Constructor. This is a floating term structure (settlement days is zero) to match QuantLib::SwaptionVolatilityCube

Definition at line 47 of file swaptionvolcubewithatm.hpp.

48 : SwaptionVolatilityStructure(0, cube->calendar(), cube->businessDayConvention(), cube->dayCounter()),
49 cube_(cube) {
50 enableExtrapolation(cube_->allowsExtrapolation());
51 registerWith(cube);
52 }
QuantLib::ext::shared_ptr< SwaptionVolatilityCube > cube() const
QuantLib::ext::shared_ptr< SwaptionVolatilityCube > cube_
+ Here is the call graph for this function:

Member Function Documentation

◆ dayCounter()

DayCounter dayCounter ( ) const
override

Definition at line 56 of file swaptionvolcubewithatm.hpp.

56{ return cube_->dayCounter(); }

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 57 of file swaptionvolcubewithatm.hpp.

57{ return cube_->maxDate(); }

◆ maxTime()

Time maxTime ( ) const
override

Definition at line 58 of file swaptionvolcubewithatm.hpp.

58{ return cube_->maxTime(); }

◆ referenceDate()

const Date & referenceDate ( ) const
override

Definition at line 59 of file swaptionvolcubewithatm.hpp.

59{ return cube_->referenceDate(); }

◆ calendar()

Calendar calendar ( ) const
override

Definition at line 60 of file swaptionvolcubewithatm.hpp.

60{ return cube_->calendar(); }

◆ settlementDays()

Natural settlementDays ( ) const
override

Definition at line 61 of file swaptionvolcubewithatm.hpp.

61{ return cube_->settlementDays(); }

◆ minStrike()

Rate minStrike ( ) const
override

Definition at line 64 of file swaptionvolcubewithatm.hpp.

64{ return cube_->minStrike(); }

◆ maxStrike()

Rate maxStrike ( ) const
override

Definition at line 65 of file swaptionvolcubewithatm.hpp.

65{ return cube_->maxStrike(); }

◆ maxSwapTenor()

const Period & maxSwapTenor ( ) const
override

Definition at line 69 of file swaptionvolcubewithatm.hpp.

69{ return cube_->maxSwapTenor(); }

◆ volatilityType()

VolatilityType volatilityType ( ) const
override

Definition at line 70 of file swaptionvolcubewithatm.hpp.

70{ return cube_->volatilityType(); }

◆ cube()

QuantLib::ext::shared_ptr< SwaptionVolatilityCube > cube ( ) const

Definition at line 73 of file swaptionvolcubewithatm.hpp.

73{ return cube_; }
+ Here is the caller graph for this function:

◆ smileSectionImpl()

QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl ( Time  optionTime,
Time  swapLength 
) const
overrideprotected

Definition at line 77 of file swaptionvolcubewithatm.hpp.

77 {
78 return cube_->smileSection(optionTime, swapLength);
79 }

◆ volatilityImpl()

Volatility volatilityImpl ( Time  optionTime,
Time  swapLength,
Rate  strike 
) const
overrideprotected

Definition at line 82 of file swaptionvolcubewithatm.hpp.

82 {
83 if (strike == Null<Real>()) {
84 return cube_->atmVol()->volatility(optionTime, swapLength, 0.0);
85 } else {
86 return cube_->volatility(optionTime, swapLength, strike);
87 }
88 }

◆ shiftImpl()

Real shiftImpl ( Time  optionTime,
Time  swapLength 
) const
overrideprotected

Definition at line 90 of file swaptionvolcubewithatm.hpp.

90{ return cube_->shift(optionTime, swapLength); }

Member Data Documentation

◆ cube_

QuantLib::ext::shared_ptr<SwaptionVolatilityCube> cube_
private

Definition at line 93 of file swaptionvolcubewithatm.hpp.