24#ifndef quantext_fx_black_vol_surface_hpp
25#define quantext_fx_black_vol_surface_hpp
27#include <ql/experimental/fx/deltavolquote.hpp>
28#include <ql/math/interpolation.hpp>
29#include <ql/termstructures/volatility/equityfx/blackvariancecurve.hpp>
30#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
31#include <ql/termstructures/yieldtermstructure.hpp>
44 const std::vector<Volatility>& atmVols,
const std::vector<Volatility>& rr,
45 const std::vector<Volatility>& bf,
const DayCounter&
dayCounter,
const Calendar& cal,
46 const Handle<Quote>& fxSpot,
const Handle<YieldTermStructure>& domesticTS,
47 const Handle<YieldTermStructure>& foreignTS,
bool requireMonotoneVariance =
true,
48 const DeltaVolQuote::AtmType atmType = DeltaVolQuote::AtmType::AtmDeltaNeutral,
49 const DeltaVolQuote::DeltaType deltaType = DeltaVolQuote::DeltaType::Spot,
50 const Real delta = 0.25,
const Period& switchTenor = 0 * Days,
51 const DeltaVolQuote::AtmType longTermAtmType = DeltaVolQuote::AtmType::AtmDeltaNeutral,
52 const DeltaVolQuote::DeltaType longTermDeltaType = DeltaVolQuote::DeltaType::Spot);
62 Real
maxStrike()
const override {
return QL_MAX_REAL; }
66 virtual void accept(AcyclicVisitor&)
override;
72 QuantLib::ext::shared_ptr<FxSmileSection>
blackVolSmile(Time t)
const;
75 virtual Volatility
blackVolImpl(Time t, Real strike)
const override;
78 virtual QuantLib::ext::shared_ptr<FxSmileSection>
blackVolSmileImpl(Real spot, Real rd, Real rf, Time t, Volatility atm,
79 Volatility rr, Volatility bf)
const = 0;
87 std::vector<Volatility>
rr_;
88 std::vector<Volatility>
bf_;
102 Visitor<FxBlackVolatilitySurface>* v1 =
dynamic_cast<Visitor<FxBlackVolatilitySurface>*
>(&v);
106 BlackVolatilityTermStructure::accept(v);
116 const Date& refDate,
const std::vector<Date>& dates,
const std::vector<Volatility>& atmVols,
117 const std::vector<Volatility>& rr,
const std::vector<Volatility>& bf,
const DayCounter& dc,
const Calendar& cal,
118 const Handle<Quote>& fx,
const Handle<YieldTermStructure>& dom,
const Handle<YieldTermStructure>& fore,
119 bool requireMonotoneVariance =
true,
const bool firstApprox =
false,
120 const DeltaVolQuote::AtmType atmType = DeltaVolQuote::AtmType::AtmDeltaNeutral,
121 const DeltaVolQuote::DeltaType deltaType = DeltaVolQuote::DeltaType::Spot,
const Real delta = 0.25,
122 const Period& switchTenor = 0 * Days,
123 const DeltaVolQuote::AtmType longTermAtmType = DeltaVolQuote::AtmType::AtmDeltaNeutral,
124 const DeltaVolQuote::DeltaType longTermDeltaType = DeltaVolQuote::DeltaType::Spot)
125 :
FxBlackVolatilitySurface(refDate, dates, atmVols, rr, bf, dc, cal, fx, dom, fore, requireMonotoneVariance,
126 atmType, deltaType, delta, switchTenor, longTermAtmType, longTermDeltaType),
131 virtual QuantLib::ext::shared_ptr<FxSmileSection>
blackVolSmileImpl(Real spot, Real rd, Real rf, Time t, Volatility atm,
132 Volatility rr, Volatility bf)
const override;
Fx Black vanna volga volatility surface.
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)
virtual QuantLib::ext::shared_ptr< FxSmileSection > blackVolSmileImpl(Real spot, Real rd, Real rf, Time t, Volatility atm, Volatility rr, Volatility bf) const override
this must be implemented.
Fx Black volatility surface.
DeltaVolQuote::AtmType atmType_
virtual QuantLib::ext::shared_ptr< FxSmileSection > blackVolSmileImpl(Real spot, Real rd, Real rf, Time t, Volatility atm, Volatility rr, Volatility bf) const =0
this must be implemented.
Handle< YieldTermStructure > foreignTS_
Real minStrike() const override
std::vector< Time > times_
virtual void accept(AcyclicVisitor &) override
BlackVarianceCurve atmCurve_
Handle< YieldTermStructure > domesticTS_
QuantLib::ext::shared_ptr< FxSmileSection > blackVolSmile(Time t) const
Return an FxSmile for the time t.
DayCounter dayCounter() const override
Date maxDate() const override
DeltaVolQuote::AtmType longTermAtmType_
virtual Volatility blackVolImpl(Time t, Real strike) const override
Real maxStrike() const override
DeltaVolQuote::DeltaType deltaType_
std::vector< Volatility > bf_
DeltaVolQuote::DeltaType longTermDeltaType_
std::vector< Volatility > rr_
FX smile section assuming a strike/volatility space using vanna volga method.