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

Fx Black vanna volga volatility surface. More...

#include <qle/termstructures/fxblackvolsurface.hpp>

+ Inheritance diagram for FxBlackVannaVolgaVolatilitySurface:
+ Collaboration diagram for FxBlackVannaVolgaVolatilitySurface:

Public Member Functions

 FxBlackVannaVolgaVolatilitySurface (const Date &refDate, const std::vector< Date > &dates, const std::vector< Volatility > &atmVols, const std::vector< Volatility > &rr, const std::vector< Volatility > &bf, const DayCounter &dc, const Calendar &cal, const Handle< Quote > &fx, const Handle< YieldTermStructure > &dom, const Handle< YieldTermStructure > &fore, bool requireMonotoneVariance=true, const bool firstApprox=false, const DeltaVolQuote::AtmType atmType=DeltaVolQuote::AtmType::AtmDeltaNeutral, const DeltaVolQuote::DeltaType deltaType=DeltaVolQuote::DeltaType::Spot, const Real delta=0.25, const Period &switchTenor=0 *Days, const DeltaVolQuote::AtmType longTermAtmType=DeltaVolQuote::AtmType::AtmDeltaNeutral, const DeltaVolQuote::DeltaType longTermDeltaType=DeltaVolQuote::DeltaType::Spot)
 
- Public Member Functions inherited from FxBlackVolatilitySurface
 FxBlackVolatilitySurface (const Date &referenceDate, const std::vector< Date > &dates, const std::vector< Volatility > &atmVols, const std::vector< Volatility > &rr, const std::vector< Volatility > &bf, const DayCounter &dayCounter, const Calendar &cal, const Handle< Quote > &fxSpot, const Handle< YieldTermStructure > &domesticTS, const Handle< YieldTermStructure > &foreignTS, bool requireMonotoneVariance=true, const DeltaVolQuote::AtmType atmType=DeltaVolQuote::AtmType::AtmDeltaNeutral, const DeltaVolQuote::DeltaType deltaType=DeltaVolQuote::DeltaType::Spot, const Real delta=0.25, const Period &switchTenor=0 *Days, const DeltaVolQuote::AtmType longTermAtmType=DeltaVolQuote::AtmType::AtmDeltaNeutral, const DeltaVolQuote::DeltaType longTermDeltaType=DeltaVolQuote::DeltaType::Spot)
 
DayCounter dayCounter () const override
 
Date maxDate () const override
 
Real minStrike () const override
 
Real maxStrike () const override
 
virtual void accept (AcyclicVisitor &) override
 
QuantLib::ext::shared_ptr< FxSmileSectionblackVolSmile (Time t) const
 Return an FxSmile for the time t. More...
 

Protected Member Functions

virtual QuantLib::ext::shared_ptr< FxSmileSectionblackVolSmileImpl (Real spot, Real rd, Real rf, Time t, Volatility atm, Volatility rr, Volatility bf) const override
 this must be implemented. More...
 
- Protected Member Functions inherited from FxBlackVolatilitySurface
virtual Volatility blackVolImpl (Time t, Real strike) const override
 

Protected Attributes

bool firstApprox_
 
- Protected Attributes inherited from FxBlackVolatilitySurface
std::vector< Time > times_
 
DayCounter dayCounter_
 
Handle< Quote > fxSpot_
 
Handle< YieldTermStructure > domesticTS_
 
Handle< YieldTermStructure > foreignTS_
 
BlackVarianceCurve atmCurve_
 
std::vector< Volatility > rr_
 
std::vector< Volatility > bf_
 
DeltaVolQuote::AtmType atmType_
 
DeltaVolQuote::DeltaType deltaType_
 
Real delta_
 
Period switchTenor_
 
DeltaVolQuote::AtmType longTermAtmType_
 
DeltaVolQuote::DeltaType longTermDeltaType_
 
Interpolation rrCurve_
 
Interpolation bfCurve_
 
Date maxDate_
 

Detailed Description

Fx Black vanna volga volatility surface.

This class calculates time/strike dependent Black volatilities

Definition at line 113 of file fxblackvolsurface.hpp.

Constructor & Destructor Documentation

◆ FxBlackVannaVolgaVolatilitySurface()

FxBlackVannaVolgaVolatilitySurface ( const Date &  refDate,
const std::vector< Date > &  dates,
const std::vector< Volatility > &  atmVols,
const std::vector< Volatility > &  rr,
const std::vector< Volatility > &  bf,
const DayCounter &  dc,
const Calendar &  cal,
const Handle< Quote > &  fx,
const Handle< YieldTermStructure > &  dom,
const Handle< YieldTermStructure > &  fore,
bool  requireMonotoneVariance = true,
const bool  firstApprox = false,
const DeltaVolQuote::AtmType  atmType = DeltaVolQuote::AtmType::AtmDeltaNeutral,
const DeltaVolQuote::DeltaType  deltaType = DeltaVolQuote::DeltaType::Spot,
const Real  delta = 0.25,
const Period &  switchTenor = 0 * Days,
const DeltaVolQuote::AtmType  longTermAtmType = DeltaVolQuote::AtmType::AtmDeltaNeutral,
const DeltaVolQuote::DeltaType  longTermDeltaType = DeltaVolQuote::DeltaType::Spot 
)

Definition at line 115 of file fxblackvolsurface.hpp.

125 : FxBlackVolatilitySurface(refDate, dates, atmVols, rr, bf, dc, cal, fx, dom, fore, requireMonotoneVariance,
126 atmType, deltaType, delta, switchTenor, longTermAtmType, longTermDeltaType),
127 firstApprox_(firstApprox) {}
FxBlackVolatilitySurface(const Date &referenceDate, const std::vector< Date > &dates, const std::vector< Volatility > &atmVols, const std::vector< Volatility > &rr, const std::vector< Volatility > &bf, const DayCounter &dayCounter, const Calendar &cal, const Handle< Quote > &fxSpot, const Handle< YieldTermStructure > &domesticTS, const Handle< YieldTermStructure > &foreignTS, bool requireMonotoneVariance=true, const DeltaVolQuote::AtmType atmType=DeltaVolQuote::AtmType::AtmDeltaNeutral, const DeltaVolQuote::DeltaType deltaType=DeltaVolQuote::DeltaType::Spot, const Real delta=0.25, const Period &switchTenor=0 *Days, const DeltaVolQuote::AtmType longTermAtmType=DeltaVolQuote::AtmType::AtmDeltaNeutral, const DeltaVolQuote::DeltaType longTermDeltaType=DeltaVolQuote::DeltaType::Spot)

Member Function Documentation

◆ blackVolSmileImpl()

QuantLib::ext::shared_ptr< FxSmileSection > blackVolSmileImpl ( Real  spot,
Real  rd,
Real  rf,
Time  t,
Volatility  atm,
Volatility  rr,
Volatility  bf 
) const
overrideprotectedvirtual

this must be implemented.

Implements FxBlackVolatilitySurface.

Definition at line 109 of file fxblackvolsurface.cpp.

112 {
113 QL_REQUIRE(t > 0, "FxBlackVannaVolgaVolatilitySurface::blackVolSmileImpl(): positive expiry time expected");
114 Real switchTime = switchTenor_ == 0 * Days ? QL_MAX_REAL : timeFromReference(optionDateFromTenor(switchTenor_));
115 DeltaVolQuote::AtmType at;
116 DeltaVolQuote::DeltaType dt;
117 if (t < switchTime && !close_enough(t, switchTime)) {
118 at = atmType_;
119 dt = deltaType_;
120 } else {
121 at = longTermAtmType_;
123 }
124 return QuantLib::ext::make_shared<VannaVolgaSmileSection>(spot, rd, rf, t, atm, rr, bf, firstApprox_, at, dt, delta_);
125}
DeltaVolQuote::AtmType longTermAtmType_
DeltaVolQuote::DeltaType deltaType_
DeltaVolQuote::DeltaType longTermDeltaType_
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
+ Here is the call graph for this function:

Member Data Documentation

◆ firstApprox_

bool firstApprox_
protected

Definition at line 130 of file fxblackvolsurface.hpp.