24#ifndef quantext_swaptionvolcubewithatm_hpp
25#define quantext_swaptionvolcubewithatm_hpp
27#include <ql/termstructures/volatility/swaption/swaptionvolcube.hpp>
29#include <ql/shared_ptr.hpp>
50 enableExtrapolation(
cube_->allowsExtrapolation());
73 QuantLib::ext::shared_ptr<SwaptionVolatilityCube>
cube()
const {
return cube_; }
77 QuantLib::ext::shared_ptr<SmileSection>
smileSectionImpl(Time optionTime, Time swapLength)
const override {
78 return cube_->smileSection(optionTime, swapLength);
82 Volatility
volatilityImpl(Time optionTime, Time swapLength, Rate strike)
const override {
83 if (strike == Null<Real>()) {
84 return cube_->atmVol()->volatility(optionTime, swapLength, 0.0);
86 return cube_->volatility(optionTime, swapLength, strike);
90 Real
shiftImpl(Time optionTime, Time swapLength)
const override {
return cube_->shift(optionTime, swapLength); }
93 QuantLib::ext::shared_ptr<SwaptionVolatilityCube>
cube_;
Wrapper class for a SwaptionVolatilityCube that easily and efficiently exposes ATM vols.
QuantLib::ext::shared_ptr< SwaptionVolatilityCube > cube() const
Calendar calendar() const override
Volatility volatilityImpl(Time optionTime, Time swapLength, Rate strike) const override
QuantLib::ext::shared_ptr< SwaptionVolatilityCube > cube_
Rate maxStrike() const override
Rate minStrike() const override
QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl(Time optionTime, Time swapLength) const override
const Date & referenceDate() const override
Real shiftImpl(Time optionTime, Time swapLength) const override
VolatilityType volatilityType() const override
Natural settlementDays() const override
DayCounter dayCounter() const override
Date maxDate() const override
const Period & maxSwapTenor() const override
Time maxTime() const override
SwaptionVolCubeWithATM(const QuantLib::ext::shared_ptr< SwaptionVolatilityCube > &cube)