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

#include <qle/termstructures/blackvariancesurfacemoneyness.hpp>

+ Inheritance diagram for BlackVarianceSurfaceMoneynessSpot:
+ Collaboration diagram for BlackVarianceSurfaceMoneynessSpot:

Public Member Functions

 BlackVarianceSurfaceMoneynessSpot (const Calendar &cal, const Handle< Quote > &spot, const std::vector< Time > &times, const std::vector< Real > &moneyness, const std::vector< std::vector< Handle< Quote > > > &blackVolMatrix, const DayCounter &dayCounter, bool stickyStrike=false, bool flatExtrapMoneyness=false)
 
 BlackVarianceSurfaceMoneynessSpot (const Date &referenceDate, const Calendar &cal, const Handle< Quote > &spot, const std::vector< Time > &times, const std::vector< Real > &moneyness, const std::vector< std::vector< Handle< Quote > > > &blackVolMatrix, const DayCounter &dayCounter, bool stickyStrike=false, bool flatExtrapMoneyness=false)
 Spot moneyness variance surface with a fixed reference date. More...
 
- Public Member Functions inherited from BlackVarianceSurfaceMoneyness
 BlackVarianceSurfaceMoneyness (const Calendar &cal, const Handle< Quote > &spot, const std::vector< Time > &times, const std::vector< Real > &moneyness, const std::vector< std::vector< Handle< Quote > > > &blackVolMatrix, const DayCounter &dayCounter, bool stickyStrike, bool flatExtrapMoneyness=false)
 
 BlackVarianceSurfaceMoneyness (const Date &referenceDate, const Calendar &cal, const Handle< Quote > &spot, const std::vector< Time > &times, const std::vector< Real > &moneyness, const std::vector< std::vector< Handle< Quote > > > &blackVolMatrix, const DayCounter &dayCounter, bool stickyStrike, bool flatExtrapMoneyness=false)
 Moneyness variance surface with a fixed reference date. More...
 
Date maxDate () const override
 
Real minStrike () const override
 
Real maxStrike () const override
 
void update () override
 
void performCalculations () const override
 
virtual void accept (AcyclicVisitor &) override
 
std::vector< QuantLib::Real > moneyness () const
 

Private Member Functions

virtual Real moneyness (Time t, Real strike) const override
 

Additional Inherited Members

- Protected Member Functions inherited from BlackVarianceSurfaceMoneyness
- Protected Attributes inherited from BlackVarianceSurfaceMoneyness
bool stickyStrike_
 
Handle< Quote > spot_
 
std::vector< Time > times_
 
std::vector< Real > moneyness_
 
bool flatExtrapMoneyness_
 

Detailed Description

Black volatility surface based on spot moneyness

Definition at line 120 of file blackvariancesurfacemoneyness.hpp.

Constructor & Destructor Documentation

◆ BlackVarianceSurfaceMoneynessSpot() [1/2]

BlackVarianceSurfaceMoneynessSpot ( const Calendar &  cal,
const Handle< Quote > &  spot,
const std::vector< Time > &  times,
const std::vector< Real > &  moneyness,
const std::vector< std::vector< Handle< Quote > > > &  blackVolMatrix,
const DayCounter &  dayCounter,
bool  stickyStrike = false,
bool  flatExtrapMoneyness = false 
)

Moneyness is defined here as spot moneyness, i.e. K/S

Definition at line 117 of file blackvariancesurfacemoneyness.cpp.

121 : BlackVarianceSurfaceMoneyness(cal, spot, times, moneyness, blackVolMatrix, dayCounter, stickyStrike,
122 flatExtrapMoneyness) {}
BlackVarianceSurfaceMoneyness(const Calendar &cal, const Handle< Quote > &spot, const std::vector< Time > &times, const std::vector< Real > &moneyness, const std::vector< std::vector< Handle< Quote > > > &blackVolMatrix, const DayCounter &dayCounter, bool stickyStrike, bool flatExtrapMoneyness=false)
std::vector< QuantLib::Real > moneyness() const

◆ BlackVarianceSurfaceMoneynessSpot() [2/2]

BlackVarianceSurfaceMoneynessSpot ( const Date &  referenceDate,
const Calendar &  cal,
const Handle< Quote > &  spot,
const std::vector< Time > &  times,
const std::vector< Real > &  moneyness,
const std::vector< std::vector< Handle< Quote > > > &  blackVolMatrix,
const DayCounter &  dayCounter,
bool  stickyStrike = false,
bool  flatExtrapMoneyness = false 
)

Spot moneyness variance surface with a fixed reference date.

Definition at line 124 of file blackvariancesurfacemoneyness.cpp.

128 : BlackVarianceSurfaceMoneyness(referenceDate, cal, spot, times, moneyness, blackVolMatrix, dayCounter,
129 stickyStrike, flatExtrapMoneyness) {}

Member Function Documentation

◆ moneyness()

Real moneyness ( Time  t,
Real  strike 
) const
overrideprivatevirtual

Implements BlackVarianceSurfaceMoneyness.

Definition at line 131 of file blackvariancesurfacemoneyness.cpp.

131 {
132 if (strike == Null<Real>() || strike == 0) {
133 return 1.0;
134 } else {
135 Real moneyness = strike / spot_->value();
137 if (moneyness < moneyness_.front()) {
138 moneyness = moneyness_.front();
139 } else if (moneyness > moneyness_.back()) {
140 moneyness = moneyness_.back();
141 }
142 }
143 return moneyness;
144 }
145}
+ Here is the call graph for this function: