33 const ext::shared_ptr<StrikedTypePayoff>&
payoff,
34 const ext::shared_ptr<Exercise>& exercise)
40 const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
46 accuracy, maxEvaluations, minVol, maxVol);
51 const ext::shared_ptr<GeneralizedBlackScholesProcess>& process,
60 ext::shared_ptr<SimpleQuote> volQuote(
new SimpleQuote);
62 ext::shared_ptr<GeneralizedBlackScholesProcess> newProcess =
66 std::unique_ptr<PricingEngine>
engine;
69 if (dividends.empty())
70 engine = std::make_unique<AnalyticEuropeanEngine>(newProcess);
72 engine = std::make_unique<AnalyticDividendEuropeanEngine>(newProcess, dividends);
76 if (dividends.empty())
77 engine = std::make_unique<FdBlackScholesVanillaEngine>(newProcess);
79 engine = std::make_unique<FdBlackScholesVanillaEngine>(newProcess, dividends);
82 QL_FAIL(
"unknown exercise type");
Analytic discrete-dividend European engine.
Analytic European engine.
Base class for options on a single asset.
bool isExpired() const override
returns whether the instrument might have value greater than zero.
ext::shared_ptr< Exercise > exercise_
market element returning a stored value
Volatility impliedVolatility(Real price, const ext::shared_ptr< GeneralizedBlackScholesProcess > &process, Real accuracy=1.0e-4, Size maxEvaluations=100, Volatility minVol=1.0e-7, Volatility maxVol=4.0) const
VanillaOption(const ext::shared_ptr< StrikedTypePayoff > &, const ext::shared_ptr< Exercise > &)
static ext::shared_ptr< GeneralizedBlackScholesProcess > clone(const ext::shared_ptr< GeneralizedBlackScholesProcess > &, const ext::shared_ptr< SimpleQuote > &)
static Volatility calculate(const Instrument &instrument, const PricingEngine &engine, SimpleQuote &volQuote, Real targetValue, Real accuracy, Natural maxEvaluations, Volatility minVol, Volatility maxVol)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Option exercise classes and payoff function.
Finite-differences Black Scholes vanilla option engine.
Real Volatility
volatility
std::size_t Size
size of a container
Utilities for implied-volatility calculation.
ext::shared_ptr< QuantLib::Payoff > payoff
std::vector< ext::shared_ptr< Dividend > > DividendSchedule
Vanilla option on a single asset.