24#ifndef quantext_black_variance_surface_moneyness_hpp
25#define quantext_black_variance_surface_moneyness_hpp
27#include <ql/math/interpolation.hpp>
28#include <ql/math/interpolations/interpolation2d.hpp>
29#include <ql/patterns/lazyobject.hpp>
30#include <ql/quote.hpp>
31#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
32#include <ql/termstructures/yieldtermstructure.hpp>
33#include <ql/time/daycounters/actual365fixed.hpp>
53 const std::vector<std::vector<Handle<Quote> > >& blackVolMatrix,
54 const DayCounter& dayCounter,
bool stickyStrike,
bool flatExtrapMoneyness =
false);
58 const std::vector<Time>& times,
const std::vector<Real>&
moneyness,
59 const std::vector<std::vector<Handle<Quote> > >& blackVolMatrix,
60 const DayCounter& dayCounter,
bool stickyStrike,
bool flatExtrapMoneyness =
false);
64 Date
maxDate()
const override {
return Date::maxDate(); }
69 Real
maxStrike()
const override {
return QL_MAX_REAL; }
81 virtual void accept(AcyclicVisitor&)
override;
90 virtual Real
moneyness(Time t, Real strike)
const = 0;
103 std::vector<std::vector<Handle<Quote> > >
quotes_;
111 Visitor<BlackVarianceSurfaceMoneyness>* v1 =
dynamic_cast<Visitor<BlackVarianceSurfaceMoneyness>*
>(&v);
115 BlackVarianceTermStructure::accept(v);
126 const std::vector<std::vector<Handle<Quote> > >& blackVolMatrix,
127 const DayCounter& dayCounter,
bool stickyStrike =
false,
128 bool flatExtrapMoneyness =
false);
132 const std::vector<Time>& times,
const std::vector<Real>&
moneyness,
133 const std::vector<std::vector<Handle<Quote> > >& blackVolMatrix,
134 const DayCounter& dayCounter,
bool stickyStrike =
false,
135 bool flatExtrapMoneyness =
false);
138 virtual Real
moneyness(Time t, Real strike)
const override;
148 const std::vector<std::vector<Handle<Quote> > >& blackVolMatrix,
149 const DayCounter& dayCounter,
const Handle<YieldTermStructure>& forTS,
150 const Handle<YieldTermStructure>& domTS,
bool stickyStrike =
false,
151 bool flatExtrapMoneyness =
false);
155 const std::vector<Time>& times,
const std::vector<Real>&
moneyness,
156 const std::vector<std::vector<Handle<Quote> > >& blackVolMatrix,
157 const DayCounter& dayCounter,
const Handle<YieldTermStructure>& forTS,
158 const Handle<YieldTermStructure>& domTS,
bool stickyStrike =
false,
159 bool flatExtrapMoneyness =
false);
165 virtual Real
moneyness(Time t, Real strike)
const override;
Handle< YieldTermStructure > domTS_
std::vector< Real > forwards_
QuantLib::Interpolation forwardCurve_
Handle< YieldTermStructure > forTS_
Abstract Black volatility surface based on moneyness (moneyness defined in subclasses)
void performCalculations() const override
Real blackVarianceMoneyness(Time t, Real moneyness) const
bool flatExtrapMoneyness_
Real minStrike() const override
std::vector< Time > times_
std::vector< QuantLib::Real > moneyness() const
virtual void accept(AcyclicVisitor &) override
Date maxDate() const override
Interpolation2D varianceSurface_
virtual Real blackVarianceImpl(Time t, Real strike) const override
std::vector< std::vector< Handle< Quote > > > quotes_
Real maxStrike() const override
std::vector< Real > moneyness_
virtual Real moneyness(Time t, Real strike) const =0