20#include <ql/experimental/barrieroption/mcdoublebarrierengine.hpp>
31 std::vector<DiscountFactor> discounts)
32 : barrierType_(barrierType), barrierLow_(barrierLow), barrierHigh_(barrierHigh),
33 rebate_(rebate), payoff_(type, strike), discounts_(
std::move(discounts)) {
34 QL_REQUIRE(strike>=0.0,
35 "strike less than zero not allowed");
36 QL_REQUIRE(barrierLow>0.0,
37 "low barrier less/equal zero not allowed");
38 QL_REQUIRE(barrierHigh>0.0,
39 "high barrier less/equal zero not allowed");
45 QL_REQUIRE(n>1,
"the path cannot be empty");
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
std::size_t Size
size of a container