30 ext::shared_ptr<GeneralizedBlackScholesProcess> p1,
31 ext::shared_ptr<GeneralizedBlackScholesProcess> p2,
42 const ext::shared_ptr<PlainVanillaPayoff>
payoff =
49 QL_REQUIRE(spot > 0.0,
"negative or null underlying given");
52 p1_->blackVolatility()->blackVol(
p1_->time(exercise->lastDate()),
55 p2_->blackVolatility()->blackVol(
p2_->time(exercise->lastDate()),
69 Real y1=(log(s1/strike)+(b1-(sigma1*sigma1)/2)*
T)/(sigma1*std::sqrt(
T));
72 switch (
payoff->optionType()) {
Analytic engine for two-asset correlation options.
bivariate cumulative normal distribution
Handle< Quote > correlation_
ext::shared_ptr< GeneralizedBlackScholesProcess > p1_
AnalyticTwoAssetCorrelationEngine(ext::shared_ptr< GeneralizedBlackScholesProcess > p1, ext::shared_ptr< GeneralizedBlackScholesProcess > p2, Handle< Quote > correlation)
void calculate() const override
ext::shared_ptr< GeneralizedBlackScholesProcess > p2_
Cumulative bivariate normal distribution function.
TwoAssetCorrelationOption::results results_
TwoAssetCorrelationOption::arguments arguments_
Shared handle to an observable.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
ext::shared_ptr< Exercise > exercise
ext::shared_ptr< Payoff > payoff
#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.
@ NoFrequency
null frequency
Real Time
continuous quantity with 1-year units
Real Volatility
volatility
ext::shared_ptr< QuantLib::Payoff > payoff
ext::shared_ptr< YieldTermStructure > r