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

Wrapper class for a BlackVolTermStructure that allows us to proxy one equity vol surface off another. More...

#include <qle/termstructures/blackvolsurfaceproxy.hpp>

+ Inheritance diagram for BlackVolatilitySurfaceProxy:
+ Collaboration diagram for BlackVolatilitySurfaceProxy:

Public Member Functions

 BlackVolatilitySurfaceProxy (const QuantLib::ext::shared_ptr< BlackVolTermStructure > &proxySurface, const QuantLib::ext::shared_ptr< EqFxIndexBase > &index, const QuantLib::ext::shared_ptr< EqFxIndexBase > &proxyIndex, const QuantLib::ext::shared_ptr< BlackVolTermStructure > &fxSurface=nullptr, const QuantLib::ext::shared_ptr< FxIndex > &fxIndex=nullptr, const QuantLib::ext::shared_ptr< CorrelationTermStructure > &correlation=nullptr)
 Constructor. This is a floating term structure (settlement days is zero) More...
 
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
 

Inspectors

QuantLib::ext::shared_ptr< BlackVolTermStructureproxySurface_
 
QuantLib::ext::shared_ptr< EqFxIndexBaseindex_
 
QuantLib::ext::shared_ptr< EqFxIndexBaseproxyIndex_
 
QuantLib::ext::shared_ptr< BlackVolTermStructurefxSurface_
 
QuantLib::ext::shared_ptr< FxIndexfxIndex_
 
QuantLib::ext::shared_ptr< CorrelationTermStructurecorrelation_
 
QuantLib::ext::shared_ptr< BlackVolTermStructureproxySurface () const
 
QuantLib::ext::shared_ptr< EqFxIndexBaseindex () const
 
QuantLib::ext::shared_ptr< EqFxIndexBaseproxyIndex () const
 
Volatility blackVolImpl (Time t, Real strike) const override
 

Detailed Description

Wrapper class for a BlackVolTermStructure that allows us to proxy one equity vol surface off another.

This class implements BlackVolatilityTermStructure and takes a surface (well, any BlackVolTermStructure) as an input. It also takes Handles to two EquityIndices (index and proxyIndex), where index is the 'EquityIndex' of the underlying for the surface being constructed and proxyIndex is the 'EquityIndex' for the surface being proxied off.

The vol returned from the new surface is proxied from the base, adjusting by the forward prices to match ATM:

\begin{eqnarray} \sigma_2(K,T) = \sigma_1(\frac{K}{F_2}*F_1,T) \end{eqnarray}

Where

\( \sigma_1 = \text{Volatility of underlying being proxied against}\)
\( \sigma_2 = \text{Volatility of underlying being proxied}\)
\( F_1 = \text{Forward at time T of the underlying being proxied against}\)
\( F_2 = \text{Forward at time T of the underlying being proxied}\)
\( T = \text{Time}\)
Note: This surface only proxies equity volatilities, this is because we are forced to look up the equity fixings using time instead of date and use the forecastFixing method in an EquityIndex. A more general class could be developed if need, using Index instead of EquityIndex, if the time lookup could be overcome.

Definition at line 62 of file blackvolsurfaceproxy.hpp.

Constructor & Destructor Documentation

◆ BlackVolatilitySurfaceProxy()

BlackVolatilitySurfaceProxy ( const QuantLib::ext::shared_ptr< BlackVolTermStructure > &  proxySurface,
const QuantLib::ext::shared_ptr< EqFxIndexBase > &  index,
const QuantLib::ext::shared_ptr< EqFxIndexBase > &  proxyIndex,
const QuantLib::ext::shared_ptr< BlackVolTermStructure > &  fxSurface = nullptr,
const QuantLib::ext::shared_ptr< FxIndex > &  fxIndex = nullptr,
const QuantLib::ext::shared_ptr< CorrelationTermStructure > &  correlation = nullptr 
)

Constructor. This is a floating term structure (settlement days is zero)

Definition at line 25 of file blackvolsurfaceproxy.cpp.

29 : BlackVolatilityTermStructure(0, proxySurface->calendar(), proxySurface->businessDayConvention(),
30 proxySurface->dayCounter()),
32 fxIndex_(fxIndex), correlation_(correlation) {
33
34 if (proxySurface->allowsExtrapolation())
35 this->enableExtrapolation();
36
37 registerWith(proxySurface);
38 registerWith(index);
39 registerWith(proxyIndex);
40}
QuantLib::ext::shared_ptr< EqFxIndexBase > index_
QuantLib::ext::shared_ptr< FxIndex > fxIndex_
QuantLib::ext::shared_ptr< BlackVolTermStructure > proxySurface_
QuantLib::ext::shared_ptr< EqFxIndexBase > proxyIndex_
QuantLib::ext::shared_ptr< CorrelationTermStructure > correlation_
QuantLib::ext::shared_ptr< BlackVolTermStructure > fxSurface_
QuantLib::ext::shared_ptr< EqFxIndexBase > proxyIndex() const
QuantLib::ext::shared_ptr< EqFxIndexBase > index() const
QuantLib::ext::shared_ptr< BlackVolTermStructure > proxySurface() const
+ Here is the call graph for this function:

Member Function Documentation

◆ dayCounter()

DayCounter dayCounter ( ) const
override

Definition at line 74 of file blackvolsurfaceproxy.hpp.

74{ return proxySurface_->dayCounter(); }

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 75 of file blackvolsurfaceproxy.hpp.

75{ return proxySurface_->maxDate(); }

◆ maxTime()

Time maxTime ( ) const
override

Definition at line 76 of file blackvolsurfaceproxy.hpp.

76{ return proxySurface_->maxTime(); }

◆ referenceDate()

const Date & referenceDate ( ) const
override

Definition at line 77 of file blackvolsurfaceproxy.hpp.

77{ return proxySurface_->referenceDate(); }

◆ calendar()

Calendar calendar ( ) const
override

Definition at line 78 of file blackvolsurfaceproxy.hpp.

78{ return proxySurface_->calendar(); }

◆ settlementDays()

Natural settlementDays ( ) const
override

Definition at line 79 of file blackvolsurfaceproxy.hpp.

79{ return proxySurface_->settlementDays(); }

◆ minStrike()

Rate minStrike ( ) const
override

Definition at line 77 of file blackvolsurfaceproxy.cpp.

77 {
78 return proxySurface_->minStrike() * index_->forecastFixing(0.0) / proxyIndex_->forecastFixing(0.0);
79}

◆ maxStrike()

Rate maxStrike ( ) const
override

Definition at line 81 of file blackvolsurfaceproxy.cpp.

81 {
82 return proxySurface_->maxStrike() * index_->forecastFixing(0.0) / proxyIndex_->forecastFixing(0.0);
83}

◆ proxySurface()

QuantLib::ext::shared_ptr< BlackVolTermStructure > proxySurface ( ) const

Definition at line 90 of file blackvolsurfaceproxy.hpp.

90{ return proxySurface_; }
+ Here is the caller graph for this function:

◆ index()

QuantLib::ext::shared_ptr< EqFxIndexBase > index ( ) const

Definition at line 91 of file blackvolsurfaceproxy.hpp.

91{ return index_; }
+ Here is the caller graph for this function:

◆ proxyIndex()

QuantLib::ext::shared_ptr< EqFxIndexBase > proxyIndex ( ) const

Definition at line 92 of file blackvolsurfaceproxy.hpp.

92{ return proxyIndex_; }
+ Here is the caller graph for this function:

◆ blackVolImpl()

Volatility blackVolImpl ( Time  t,
Real  strike 
) const
overrideprotected

Definition at line 42 of file blackvolsurfaceproxy.cpp.

42 {
43
44 t = std::max(t, 1E-6);
45
46 Volatility vol;
47 if (fxSurface_) {
48 // Get the Fx forward value at time t, and hence the ATM vol
49 Real fxForward = fxIndex_->forecastFixing(t);
50 Volatility fxVol = fxSurface_->blackVol(t, fxForward);
51
52 // Get the ATM vol for the proxy surface
53 Volatility proxyAtmVol = proxySurface_->blackVol(t, proxyIndex_->forecastFixing(t));
54
55 // Convert the atm vol for this surface using sqrt( sigma^2 + sigma_X^2 + 2 rho sigma sigma_X)
56 Volatility atmVol = sqrt(proxyAtmVol * proxyAtmVol + fxVol * fxVol + 2 * correlation_->correlation(t) * proxyAtmVol * fxVol);
57
58 // Get the moneyness in this surface of the strike requested
59 Real forward = index_->forecastFixing(t);
60 Real moneyness = std::log(strike / forward) / (atmVol * sqrt(t));
61
62 // Find the strike in the proxy surface that gives the same moneyness
63 Real proxyForward = proxyIndex_->forecastFixing(t);
64 Real proxyStrike = proxyForward * exp(moneyness * proxyAtmVol * sqrt(t));
65
66 // Look up the vol in the proxy surface for the proxyStrike and convert using sqrt( sigma^2 + sigma_X^2 + 2 rho sigma sigma_X)
67 Volatility proxyVol = proxySurface_->blackVol(t, proxyStrike);
68 vol = sqrt(proxyVol * proxyVol + fxVol * fxVol + 2 * correlation_->correlation(t) * proxyVol * fxVol);
69
70 } else {
71 Real adjustedStrike = strike * proxyIndex_->forecastFixing(t) / index_->forecastFixing(t);
72 vol = proxySurface_->blackVol(t, adjustedStrike);
73 }
74 return vol;
75}
RandomVariable sqrt(RandomVariable x)
CompiledFormula exp(CompiledFormula x)
+ Here is the call graph for this function:

Member Data Documentation

◆ proxySurface_

QuantLib::ext::shared_ptr<BlackVolTermStructure> proxySurface_
private

Definition at line 100 of file blackvolsurfaceproxy.hpp.

◆ index_

QuantLib::ext::shared_ptr<EqFxIndexBase> index_
private

Definition at line 101 of file blackvolsurfaceproxy.hpp.

◆ proxyIndex_

QuantLib::ext::shared_ptr<EqFxIndexBase> proxyIndex_
private

Definition at line 101 of file blackvolsurfaceproxy.hpp.

◆ fxSurface_

QuantLib::ext::shared_ptr<BlackVolTermStructure> fxSurface_
private

Definition at line 102 of file blackvolsurfaceproxy.hpp.

◆ fxIndex_

QuantLib::ext::shared_ptr<FxIndex> fxIndex_
private

Definition at line 103 of file blackvolsurfaceproxy.hpp.

◆ correlation_

QuantLib::ext::shared_ptr<CorrelationTermStructure> correlation_
private

Definition at line 104 of file blackvolsurfaceproxy.hpp.