31 std::vector<DiscountFactor> discounts)
32 : barrierType_(barrierType), barrierLow_(barrierLow), barrierHigh_(barrierHigh),
33 rebate_(rebate),
payoff_(type, strike), discounts_(
std::move(discounts)) {
35 "strike less than zero not allowed");
37 "low barrier less/equal zero not allowed");
39 "high barrier less/equal zero not allowed");
47 bool isOptionActive =
false;
48 Size knockNode = null;
55 isOptionActive =
true;
56 for (i = 0; i <
n-1; i++) {
57 new_asset_price = path[i + 1];
60 isOptionActive =
false;
61 if (knockNode == null)
68 isOptionActive =
false;
69 for (i = 0; i <
n-1; i++) {
70 new_asset_price = path[i + 1];
73 isOptionActive =
true;
74 if (knockNode == null)
81 QL_FAIL(
"unknown barrier type");
93 QL_FAIL(
"unknown barrier type");
PlainVanillaPayoff payoff_
std::vector< DiscountFactor > discounts_
DoubleBarrier::Type barrierType_
DoubleBarrierPathPricer(DoubleBarrier::Type barrierType, Real barrierLow, Real barrieHigh, Real rebate, Option::Type type, Real strike, std::vector< DiscountFactor > discounts)
Real operator()(const Path &path) const override
template class providing a null value for a given type.
single-factor random walk
Real back() const
final asset value
#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)
const ext::shared_ptr< Payoff > payoff_
std::size_t Size
size of a container
Monte Carlo barrier option engines.