20#include <ql/experimental/exoticoptions/twoassetbarrieroption.hpp>
21#include <ql/exercise.hpp>
22#include <ql/event.hpp>
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) {
59 QL_FAIL(
"unknown type");
62 QL_REQUIRE(barrier !=
Null<Real>(),
"no barrier given");
66 switch (arguments_.barrierType) {
69 return underlying < arguments_.barrier;
72 return underlying > arguments_.barrier;
74 QL_FAIL(
"unknown type");
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)
Placeholder for enumerated barrier types.