22#include <ql/exercise.hpp>
23#include <ql/instruments/payoffs.hpp>
24#include <ql/models/equity/hestonmodelhelper.hpp>
25#include <ql/pricingengines/blackformula.hpp>
26#include <ql/processes/hestonprocess.hpp>
27#include <ql/quotes/simplequote.hpp>
36 const Real strikePrice,
43 strikePrice_(strikePrice), riskFreeRate_(riskFreeRate), dividendYield_(dividendYield) {
51 const Real strikePrice,
57 calendar_(
std::move(calendar)), s0_(s0), strikePrice_(strikePrice),
58 riskFreeRate_(riskFreeRate), dividendYield_(dividendYield) {
72 ext::shared_ptr<StrikedTypePayoff> payoff(
74 ext::shared_ptr<Exercise> exercise =
76 option_ = ext::make_shared<VanillaOption>(payoff, exercise);
liquid Black76 market instrument used during calibration
void performCalculations() const override
Handle< Quote > volatility() const
returns the volatility Handle
ext::shared_ptr< PricingEngine > engine_
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Shared handle to an observable.
void performCalculations() const override
Real blackPrice(Real volatility) const override
Black or Bachelier price given a volatility.
Real modelValue() const override
returns the price of the instrument according to the model
const Handle< YieldTermStructure > dividendYield_
const Handle< Quote > s0_
HestonModelHelper(const Period &maturity, Calendar calendar, Real s0, Real strikePrice, const Handle< Quote > &volatility, const Handle< YieldTermStructure > &riskFreeRate, const Handle< YieldTermStructure > ÷ndYield, BlackCalibrationHelper::CalibrationErrorType errorType=BlackCalibrationHelper::RelativePriceError)
ext::shared_ptr< VanillaOption > option_
const Handle< YieldTermStructure > riskFreeRate_
virtual void calculate() const
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
purely virtual base class for market observables
market element returning a stored value
Real blackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount, Real displacement)