Logo
Reference manual - version qle_version
BlackVolatilityWithATM Class Reference

Wrapper class for a BlackVolTermStructure that easily exposes ATM vols. More...

#include <qle/termstructures/blackvolsurfacewithatm.hpp>

Inheritance diagram for BlackVolatilityWithATM:

Public Member Functions

 BlackVolatilityWithATM (const QuantLib::ext::shared_ptr< BlackVolTermStructure > &surface, const Handle< Quote > &spot, const Handle< YieldTermStructure > &yield1=Handle< YieldTermStructure >(), const Handle< YieldTermStructure > &yield2=Handle< YieldTermStructure >())
 Constructor. This is a floating term structure (settlement days is zero).
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< BlackVolTermStructuresurface () const
Handle< Quotespot () const
Handle< YieldTermStructure > yield1 () const
Handle< YieldTermStructure > yield2 () const
Volatility blackVolImpl (Time t, Real strike) const override

Detailed Description

Wrapper class for a BlackVolTermStructure that easily exposes ATM vols.

This class implements BlackVolatilityTermStructure and takes a surface (well, any BlackVolTermStructure) as an input. If asked for a volatility with strike=Null<Real>() it will calculate the forward value and use this as the strike, this makes it easy to access ATMF values. Only Null<Real>() triggers ATM forward calculation; numeric strike values (including 0) are passed through unchanged to the underlying surface.

The forward value is calculated using the input spot and yield curves, so can be used for both FX and Equity vols.

For FX markets, one should set the spot to be the FX spot rate, yield1 to be the base discount curve and yield2 to be the reference discount curve (e.g. EURUSD, yield1 = EUR).

For Equity markets, one should set the spot to be the equity price, yield1 to be the discount curve and yield2 to be the dividend curve.