29 const ext::shared_ptr<StrikedTypePayoff>&
payoff,
30 const ext::shared_ptr<Exercise>& exercise)
31 :
Option(
payoff, exercise), barrierType_(barrierType), barrier_(barrier) {}
37 QL_REQUIRE(moreArgs !=
nullptr,
"wrong argument type");
52 switch (barrierType) {
66 switch (arguments_.barrierType) {
69 return underlying < arguments_.barrier;
72 return underlying > arguments_.barrier;
virtual bool hasOccurred(const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const
returns true if an event has already occurred before a date
template class providing a null value for a given type.
void validate() const override
void setupArguments(PricingEngine::arguments *) const override
ext::shared_ptr< Exercise > exercise_
Arguments for two-asset barrier option calculation
void validate() const override
bool triggered(Real underlying) const
Barrier::Type barrierType_
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
returns whether the instrument might have value greater than zero.
TwoAssetBarrierOption(Barrier::Type barrierType, Real barrier, 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)
Base class for events associated with a given date.
Option exercise classes and payoff function.
ext::shared_ptr< QuantLib::Payoff > payoff
Placeholder for enumerated barrier types.
Barrier option on two assets.