31 const ext::shared_ptr<StrikedTypePayoff>&
payoff,
32 const ext::shared_ptr<Exercise>& exercise)
34 barrierType_(barrierType), barrierRange_(barrierRange),
35 barrier_(barrier), rebate_(rebate),
36 coverEventDate_(coverEventDate) {}
43 QL_REQUIRE(moreArgs !=
nullptr,
"wrong argument type");
58 OneAssetOption::arguments::validate();
61 switch (barrierType) {
66 "in-barrier requires Start or End range");
73 "out-barrier requires Start, EndB1 or EndB2 range");
76 QL_FAIL(
"unknown barrier type");
82 QL_REQUIRE(coverEventDate < exercise->lastDate(),
83 "cover event date equal or later than exercise date");
virtual void setupArguments(PricingEngine::arguments *) const
template class providing a null value for a given type.
Base class for options on a single asset.
Arguments for barrier option calculation
void validate() const override
PartialBarrier::Type barrierType_
void setupArguments(PricingEngine::arguments *) const override
PartialBarrier::Range barrierRange_
PartialTimeBarrierOption(PartialBarrier::Type barrierType, PartialBarrier::Range barrierRange, Real barrier, Real rebate, Date coverEventDate, const ext::shared_ptr< StrikedTypePayoff > &payoff, const ext::shared_ptr< Exercise > &exercise)
#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.
ext::shared_ptr< QuantLib::Payoff > payoff
Partial-time barrier option.