29 ext::shared_ptr<GeneralizedBlackScholesProcess> process)
30 : process_(
std::move(process)) {
35 ext::shared_ptr<GeneralizedBlackScholesProcess> process,
46 ext::shared_ptr<YieldTermStructure> discountPtr =
48 process_->riskFreeRate().currentLink() :
52 "not an European option");
54 ext::shared_ptr<StrikedTypePayoff>
payoff =
55 ext::dynamic_pointer_cast<StrikedTypePayoff>(arguments_.payoff);
59 process_->blackVolatility()->blackVariance(
60 arguments_.exercise->lastDate(),
64 arguments_.exercise->lastDate());
65 DiscountFactor df = discountPtr->discount(arguments_.exercise->lastDate());
67 process_->riskFreeRate()->discount(arguments_.exercise->lastDate());
69 QL_REQUIRE(spot > 0.0,
"negative or null underlying given");
70 Real forwardPrice = spot * dividendDiscount / riskFreeDiscountForFwdEstimation;
85 arguments_.exercise->lastDate());
89 arguments_.exercise->lastDate());
93 arguments_.exercise->lastDate());
107 Real tte =
process_->blackVolatility()->timeFromReference(arguments_.exercise->lastDate());
108 results_.additionalResults[
"spot"] = spot;
109 results_.additionalResults[
"dividendDiscount"] = dividendDiscount;
110 results_.additionalResults[
"riskFreeDiscount"] = riskFreeDiscountForFwdEstimation;
111 results_.additionalResults[
"forward"] = forwardPrice;
114 results_.additionalResults[
"timeToExpiry"] = tte;
Analytic European engine.
Black-formula calculator class.
const YieldTermStructure & discountCurve_
const Instrument::results * results_
Handle< YieldTermStructure > discountCurve_
void calculate() const override
AnalyticEuropeanEngine(ext::shared_ptr< GeneralizedBlackScholesProcess >)
ext::shared_ptr< GeneralizedBlackScholesProcess > process_
Black 1976 calculator class.
Real dividendRho(Time maturity) const
virtual Real delta(Real spot) const
Real vega(Time maturity) const
Real itmCashProbability() const
Real strikeSensitivity() const
virtual Real gamma(Real spot) const
virtual Real elasticity(Real spot) const
virtual Real thetaPerDay(Real spot, Time maturity) const
Real deltaForward() const
virtual Real theta(Real spot, Time maturity) const
Real rho(Time maturity) const
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
Shared handle to an observable.
template class providing a null value for a given type.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Option exercise classes and payoff function.
LinearInterpolation variance
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
ext::shared_ptr< QuantLib::Payoff > payoff