21#include <ql/exercise.hpp>
22#include <ql/pricingengines/asian/analytic_cont_geom_av_price.hpp>
23#include <ql/pricingengines/blackcalculator.hpp>
24#include <ql/processes/blackscholesprocess.hpp>
31 ext::shared_ptr<GeneralizedBlackScholesProcess> process)
32 : process_(
std::move(process)) {
39 "not a geometric average option");
41 "not an European Option");
45 ext::shared_ptr<PlainVanillaPayoff> payoff =
46 ext::dynamic_pointer_cast<PlainVanillaPayoff>(
arguments_.payoff);
47 QL_REQUIRE(payoff,
"non-plain payoff given");
50 process_->blackVolatility()->blackVol(exercise, payoff->strike());
52 process_->blackVolatility()->blackVariance(exercise,
55 process_->riskFreeRate()->discount(exercise);
61 Spread dividendYield = 0.5 * (
62 process_->riskFreeRate()->zeroRate(exercise, rfdc,
64 process_->dividendYield()->zeroRate(exercise, divdc,
66 volatility*volatility/6.0);
69 process_->dividendYield()->referenceDate(), exercise);
73 QL_REQUIRE(spot > 0.0,
"negative or null underlying");
74 Real forward = spot * dividendDiscount / riskFreeDiscount;
90 process_->blackVolatility()->referenceDate(),
AnalyticContinuousGeometricAveragePriceAsianEngine(ext::shared_ptr< GeneralizedBlackScholesProcess > process)
void calculate() const override
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
virtual Real gamma(Real spot) const
virtual Real theta(Real spot, Time maturity) const
Real rho(Time maturity) const
Average::Type averageType
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.
ContinuousAveragingAsianOption::results results_
ContinuousAveragingAsianOption::arguments arguments_
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
@ NoFrequency
null frequency
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
Real Volatility
volatility
Real Spread
spreads on interest rates