25#ifndef quantlib_black_vol_term_structures_hpp
26#define quantlib_black_vol_term_structures_hpp
71 bool extrapolate =
false)
const;
75 bool extrapolate =
false)
const;
79 bool extrapolate =
false)
const;
83 bool extrapolate =
false)
const;
88 bool extrapolate =
false)
const;
93 bool extrapolate =
false)
const;
98 bool extrapolate =
false)
const;
103 bool extrapolate =
false)
const;
219 bool extrapolate)
const {
228 bool extrapolate)
const {
236 bool extrapolate)
const {
245 bool extrapolate)
const {
256 QL_FAIL(
"not a Black-volatility term structure visitor");
277 Time nonZeroMaturity = (
t==0.0 ? 0.00001 :
t);
278 Real var = blackVarianceImpl(nonZeroMaturity, strike);
279 return std::sqrt(var/nonZeroMaturity);
degenerate base class for the Acyclic Visitor pattern
Black variance term structure.
void accept(AcyclicVisitor &) override
Volatility blackVolImpl(Time t, Real strike) const override
Black-volatility term structure.
~BlackVolTermStructure() override=default
virtual void accept(AcyclicVisitor &)
virtual Volatility blackVolImpl(Time t, Real strike) const =0
Black volatility calculation.
Volatility blackVol(const Date &maturity, Real strike, bool extrapolate=false) const
spot volatility
virtual Real blackVarianceImpl(Time t, Real strike) const =0
Black variance calculation.
Real blackForwardVariance(const Date &date1, const Date &date2, Real strike, bool extrapolate=false) const
forward (at-the-money) variance
Volatility blackForwardVol(const Date &date1, const Date &date2, Real strike, bool extrapolate=false) const
forward (at-the-money) volatility
Real blackVariance(const Date &maturity, Real strike, bool extrapolate=false) const
spot variance
Black-volatility term structure.
void accept(AcyclicVisitor &) override
Real blackVarianceImpl(Time maturity, Real strike) const override
virtual Natural settlementDays() const
the settlementDays used for reference date calculation
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
Time timeFromReference(const Date &date) const
date/time conversion
void checkRange(const Date &d, bool extrapolate) const
date-range check
Visitor for a specific class
virtual void visit(T &)=0
Volatility term structure.
void checkStrike(Rate strike, bool extrapolate) const
strike-range check
#define QL_FAIL(message)
throw an error (possibly with file and line information)
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
Real Volatility
volatility
ext::shared_ptr< BlackVolTermStructure > v
degenerate base class for the Acyclic Visitor pattern
Volatility term structure.