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

#include <qle/termstructures/swaptionvolconstantspread.hpp>

+ Inheritance diagram for ConstantSpreadSmileSection:
+ Collaboration diagram for ConstantSpreadSmileSection:

Public Member Functions

 ConstantSpreadSmileSection (const Handle< SwaptionVolatilityStructure > &atm, const Handle< SwaptionVolatilityStructure > &cube, const Real optionTime, const Real swapLength)
 
Rate minStrike () const override
 
Rate maxStrike () const override
 
Rate atmLevel () const override
 

Protected Member Functions

Volatility volatilityImpl (Rate strike) const override
 

Private Attributes

const Handle< SwaptionVolatilityStructureatm_
 
const Handle< SwaptionVolatilityStructurecube_
 
const Real swapLength_
 
const QuantLib::ext::shared_ptr< SmileSection > section_
 
const Real atmStrike_
 

Detailed Description

Definition at line 34 of file swaptionvolconstantspread.hpp.

Constructor & Destructor Documentation

◆ ConstantSpreadSmileSection()

ConstantSpreadSmileSection ( const Handle< SwaptionVolatilityStructure > &  atm,
const Handle< SwaptionVolatilityStructure > &  cube,
const Real  optionTime,
const Real  swapLength 
)

Definition at line 36 of file swaptionvolconstantspread.hpp.

39 : SmileSection(optionTime, DayCounter(), atm->volatilityType(),
40 atm->volatilityType() == ShiftedLognormal ? atm->shift(optionTime, swapLength) : 0.0),
41 atm_(atm), cube_(cube), swapLength_(swapLength), section_(cube_->smileSection(optionTime, swapLength_)),
42 atmStrike_(section_->atmLevel()) {
43 registerWith(atm_);
44 registerWith(cube_);
45 }
const QuantLib::ext::shared_ptr< SmileSection > section_
const Handle< SwaptionVolatilityStructure > cube_
const Handle< SwaptionVolatilityStructure > atm_

Member Function Documentation

◆ minStrike()

Rate minStrike ( ) const
override

Definition at line 46 of file swaptionvolconstantspread.hpp.

46{ return cube_->minStrike(); }

◆ maxStrike()

Rate maxStrike ( ) const
override

Definition at line 47 of file swaptionvolconstantspread.hpp.

47{ return cube_->maxStrike(); }

◆ atmLevel()

Rate atmLevel ( ) const
override

Definition at line 48 of file swaptionvolconstantspread.hpp.

48{ return Null<Real>(); }

◆ volatilityImpl()

Volatility volatilityImpl ( Rate  strike) const
overrideprotected

Definition at line 25 of file swaptionvolconstantspread.cpp.

25 {
26 Real t = exerciseTime();
27 Real s = section_->volatility(strike) - section_->volatility(atmStrike_);
28 Real v = atm_->volatility(t, swapLength_, strike);
29 return v + s;
30}

Member Data Documentation

◆ atm_

const Handle<SwaptionVolatilityStructure> atm_
private

Definition at line 54 of file swaptionvolconstantspread.hpp.

◆ cube_

const Handle<SwaptionVolatilityStructure> cube_
private

Definition at line 54 of file swaptionvolconstantspread.hpp.

◆ swapLength_

const Real swapLength_
private

Definition at line 55 of file swaptionvolconstantspread.hpp.

◆ section_

const QuantLib::ext::shared_ptr<SmileSection> section_
private

Definition at line 56 of file swaptionvolconstantspread.hpp.

◆ atmStrike_

const Real atmStrike_
private

Definition at line 57 of file swaptionvolconstantspread.hpp.