33 "positive spot value required");
36 "positive discount required");
39 "positive dividend discount required");
42 "negative variance not allowed");
53 ext::shared_ptr<CashOrNothingPayoff> coo =
54 ext::dynamic_pointer_cast<CashOrNothingPayoff>(
payoff);
56 K_ = coo->cashPayoff();
60 ext::shared_ptr<AssetOrNothingPayoff> aoo =
61 ext::dynamic_pointer_cast<AssetOrNothingPayoff>(
payoff);
113 if (log_S_H_ * phi >0)
162 QL_FAIL(
"invalid option type");
Analytical formulae for american exercise with payoff at expiry.
DiscountFactor dividendDiscount_
AmericanPayoffAtExpiry(Real spot, DiscountFactor discount, DiscountFactor dividendDiscount, Real variance, const ext::shared_ptr< StrikedTypePayoff > &payoff, bool knock_in=true)
Cumulative normal distribution function.
#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)
LinearInterpolation variance
Real DiscountFactor
discount factor between dates
ext::shared_ptr< QuantLib::Payoff > payoff
normal, cumulative and inverse cumulative distributions