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

Black volatility surface that inverts an existing surface. More...

#include <qle/termstructures/blackinvertedvoltermstructure.hpp>

+ Inheritance diagram for BlackInvertedVolTermStructure:
+ Collaboration diagram for BlackInvertedVolTermStructure:

Public Member Functions

 BlackInvertedVolTermStructure (const Handle< BlackVolTermStructure > &vol)
 Constructor takes a BlackVolTermStructure and takes everything from that. More...
 
const Handle< BlackVolTermStructure > & underlyingVol () const
 return the underlying vol surface More...
 
TermStructure interface
const Date & referenceDate () const override
 
Date maxDate () const override
 
Natural settlementDays () const override
 
Calendar calendar () const override
 
Observer interface
void update () override
 
VolatilityTermStructure interface
Real minStrike () const override
 
Real maxStrike () const override
 

Visitability

Handle< BlackVolTermStructurevol_
 
virtual void accept (AcyclicVisitor &) override
 
Real invertedStrike (Real strike) const
 
virtual Real blackVarianceImpl (Time t, Real strike) const override
 
virtual Volatility blackVolImpl (Time t, Real strike) const override
 

Detailed Description

Black volatility surface that inverts an existing surface.

This class is used when one wants a USD/EUR volatility, at a given USD/EUR strike when only a EUR/USD volatility surface is present.

    \ingroup termstructures

Definition at line 38 of file blackinvertedvoltermstructure.hpp.

Constructor & Destructor Documentation

◆ BlackInvertedVolTermStructure()

Constructor takes a BlackVolTermStructure and takes everything from that.

This will work with both a floating and fixed reference date underlying surface, since we are reimplementing the reference date and update methods

Definition at line 43 of file blackinvertedvoltermstructure.hpp.

44 : BlackVolTermStructure(vol->businessDayConvention(), vol->dayCounter()), vol_(vol) {
45 registerWith(vol_);
46 }

Member Function Documentation

◆ underlyingVol()

const Handle< BlackVolTermStructure > & underlyingVol ( ) const

return the underlying vol surface

Definition at line 49 of file blackinvertedvoltermstructure.hpp.

49{ return vol_; }

◆ referenceDate()

const Date & referenceDate ( ) const
override

Definition at line 53 of file blackinvertedvoltermstructure.hpp.

53{ return vol_->referenceDate(); }
+ Here is the caller graph for this function:

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 54 of file blackinvertedvoltermstructure.hpp.

54{ return vol_->maxDate(); }
+ Here is the caller graph for this function:

◆ settlementDays()

Natural settlementDays ( ) const
override

Definition at line 55 of file blackinvertedvoltermstructure.hpp.

55{ return vol_->settlementDays(); }

◆ calendar()

Calendar calendar ( ) const
override

Definition at line 56 of file blackinvertedvoltermstructure.hpp.

56{ return vol_->calendar(); }

◆ update()

void update ( )
override

Definition at line 59 of file blackinvertedvoltermstructure.hpp.

59{ notifyObservers(); }

◆ minStrike()

Real minStrike ( ) const
override

Definition at line 63 of file blackinvertedvoltermstructure.hpp.

63 {
64 Real min = vol_->minStrike();
65 if (min == QL_MIN_REAL || min == 0)
66 return 0; // we allow ATM calls
67 else
68 return 1 / vol_->maxStrike();
69 }
CompiledFormula min(CompiledFormula x, const CompiledFormula &y)
+ Here is the call graph for this function:

◆ maxStrike()

Real maxStrike ( ) const
override

Definition at line 70 of file blackinvertedvoltermstructure.hpp.

70 {
71 Real min = vol_->minStrike();
72 if (min == QL_MIN_REAL || min == 0)
73 return QL_MAX_REAL;
74 else
75 return 1 / min;
76 }
+ Here is the call graph for this function:

◆ accept()

void accept ( AcyclicVisitor &  v)
overridevirtual

Definition at line 93 of file blackinvertedvoltermstructure.hpp.

93 {
94 Visitor<BlackInvertedVolTermStructure>* v1 = dynamic_cast<Visitor<BlackInvertedVolTermStructure>*>(&v);
95 if (v1 != 0)
96 v1->visit(*this);
97 else
99}
virtual void accept(AcyclicVisitor &) override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ invertedStrike()

Real invertedStrike ( Real  strike) const
protected

Definition at line 84 of file blackinvertedvoltermstructure.hpp.

84{ return (strike == 0.0 || strike == Null<Real>()) ? strike : 1.0 / strike; }
+ Here is the caller graph for this function:

◆ blackVarianceImpl()

virtual Real blackVarianceImpl ( Time  t,
Real  strike 
) const
overrideprotectedvirtual

Definition at line 85 of file blackinvertedvoltermstructure.hpp.

85{ return vol_->blackVariance(t, invertedStrike(strike)); }
+ Here is the call graph for this function:

◆ blackVolImpl()

virtual Volatility blackVolImpl ( Time  t,
Real  strike 
) const
overrideprotectedvirtual

Definition at line 86 of file blackinvertedvoltermstructure.hpp.

86{ return vol_->blackVol(t, invertedStrike(strike)); }
+ Here is the call graph for this function:

Member Data Documentation

◆ vol_

Handle<BlackVolTermStructure> vol_
private

Definition at line 89 of file blackinvertedvoltermstructure.hpp.