41 std::max(0.0, vol)*std::sqrt(maturity),
53 hestonModel->process()->riskFreeRate()->dayCounter()),
54 hestonModel_(hestonModel), cpxLogFormula_(cpxLogFormula),
55 integration_(
std::move(integration)) {
60 return hestonModel_->process()->riskFreeRate()->dayCounter();
69 return std::numeric_limits<Real>::max();
80 const ext::shared_ptr<HestonProcess>& process =
hestonModel_->process();
84 const Real fwd = process->s0()->value()
85 * process->dividendYield()->discount(
t,
true) / df;
87 const ext::shared_ptr<PlainVanillaPayoff>
payoff =
88 ext::make_shared<PlainVanillaPayoff>(
94 if (npv <= 0.0)
return std::sqrt(
theta);
99 constexpr double accuracy = std::numeric_limits<double>::epsilon();
104 payoff->optionType(), strike, fwd,
t, _v, df, npv);
106 accuracy, guess, 0.01
analytic Heston-model engine based on Fourier transform
Real priceVanillaPayoff(const ext::shared_ptr< PlainVanillaPayoff > &payoff, const Date &maturity) const
Black-volatility term structure.
static Date maxDate()
latest allowed date
Shared handle to an observable.
const ext::shared_ptr< T > & currentLink() const
dereferencing
const AnalyticHestonEngine::Integration integration_
HestonBlackVolSurface(const Handle< HestonModel > &hestonModel, AnalyticHestonEngine::ComplexLogFormula cpxLogFormula=AnalyticHestonEngine::AngledContour, AnalyticHestonEngine::Integration integration=AnalyticHestonEngine::Integration::gaussLaguerre(160))
Real minStrike() const override
the minimum strike for which the term structure can return vols
const Handle< HestonModel > hestonModel_
DayCounter dayCounter() const override
the day counter used for date/time conversion
Date maxDate() const override
the latest date for which the curve can return values
Real blackVarianceImpl(Time t, Real strike) const override
Black variance calculation.
Volatility blackVolImpl(Time t, Real strike) const override
Black volatility calculation.
Real maxStrike() const override
the maximum strike for which the term structure can return vols
const AnalyticHestonEngine::ComplexLogFormula cpxLogFormula_
Calendar for reproducing theoretical calculations.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
void setMaxEvaluations(Size evaluations)
Real solve(const F &f, Real accuracy, Real guess, Real step) const
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
Real Volatility
volatility
Black volatility surface back by Heston model.
ext::shared_ptr< QuantLib::Payoff > payoff
functionals and combinators not included in the STL
Real blackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount, Real displacement)
Calendar for reproducing theoretical calculations.