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

Cube that combines an ATM matrix and vol spreads from a cube. More...

#include <qle/termstructures/blackvolconstantspread.hpp>

+ Inheritance diagram for BlackVolatilityConstantSpread:
+ Collaboration diagram for BlackVolatilityConstantSpread:

Public Member Functions

 BlackVolatilityConstantSpread (const Handle< BlackVolTermStructure > &atm, const Handle< BlackVolTermStructure > &surface)
 
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

Handle< BlackVolTermStructureatm_
 
Handle< BlackVolTermStructuresurface_
 
Rate minStrike () const override
 
Rate maxStrike () const override
 
void deepUpdate () override
 
Volatility blackVolImpl (Time t, Rate strike) const override
 
Real blackVarianceImpl (Time t, Real strike) const override
 

Detailed Description

Cube that combines an ATM matrix and vol spreads from a cube.

Notice that the TS has a floating reference date and accesses the source TS only via their time-based volatility methods.

Warning:
the given atm vol structure should be strike independent, this is not checked

Definition at line 41 of file blackvolconstantspread.hpp.

Constructor & Destructor Documentation

◆ BlackVolatilityConstantSpread()

BlackVolatilityConstantSpread ( const Handle< BlackVolTermStructure > &  atm,
const Handle< BlackVolTermStructure > &  surface 
)

Definition at line 25 of file blackvolconstantspread.cpp.

27 : BlackVolTermStructure(0, atm->calendar(), atm->businessDayConvention(), atm->dayCounter()), atm_(atm),
28 surface_(surface) {
29 enableExtrapolation(atm->allowsExtrapolation());
30 registerWith(atm);
31 registerWith(surface);
32}
Handle< BlackVolTermStructure > surface_

Member Function Documentation

◆ dayCounter()

DayCounter dayCounter ( ) const
override

Definition at line 34 of file blackvolconstantspread.cpp.

34 {
35 return atm_->dayCounter();
36}

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 38 of file blackvolconstantspread.cpp.

38 {
39 return atm_->maxDate();
40}

◆ maxTime()

Time maxTime ( ) const
override

Definition at line 42 of file blackvolconstantspread.cpp.

42 {
43 return atm_->maxTime();
44}

◆ referenceDate()

const Date & referenceDate ( ) const
override

Definition at line 46 of file blackvolconstantspread.cpp.

46 {
47 return atm_->referenceDate();
48}

◆ calendar()

Calendar calendar ( ) const
override

Definition at line 50 of file blackvolconstantspread.cpp.

50 {
51 return atm_->calendar();
52}

◆ settlementDays()

Natural settlementDays ( ) const
override

Definition at line 54 of file blackvolconstantspread.cpp.

54 {
55 return atm_->settlementDays();
56}

◆ minStrike()

Rate minStrike ( ) const
override

Definition at line 58 of file blackvolconstantspread.cpp.

58 {
59 return surface_->minStrike();
60}

◆ maxStrike()

Rate maxStrike ( ) const
override

Definition at line 62 of file blackvolconstantspread.cpp.

62 {
63 return surface_->maxStrike();
64}

◆ deepUpdate()

void deepUpdate ( )
override

Definition at line 66 of file blackvolconstantspread.cpp.

66 {
67 atm_->update();
68 update();
69}

◆ blackVolImpl()

Volatility blackVolImpl ( Time  t,
Rate  strike 
) const
overrideprotected

Definition at line 71 of file blackvolconstantspread.cpp.

71 {
72 Real s = surface_->blackVol(t, strike, true) - surface_->blackVol(t, Null<Real>(), true);
73 Real v = atm_->blackVol(t, Null<Real>(), true);
74 return v + s;
75}
+ Here is the caller graph for this function:

◆ blackVarianceImpl()

Real blackVarianceImpl ( Time  t,
Real  strike 
) const
overrideprotected

Definition at line 77 of file blackvolconstantspread.cpp.

77 {
78 Real vol = blackVolImpl(t, strike);
79 return vol * vol * t;
80}
Volatility blackVolImpl(Time t, Rate strike) const override
+ Here is the call graph for this function:

Member Data Documentation

◆ atm_

Handle<BlackVolTermStructure> atm_
private

Definition at line 69 of file blackvolconstantspread.hpp.

◆ surface_

Handle<BlackVolTermStructure> surface_
private

Definition at line 69 of file blackvolconstantspread.hpp.