27 const ext::shared_ptr<PlainVanillaPayoff>& payoff1,
28 const ext::shared_ptr<Exercise>& exercise1,
29 const ext::shared_ptr<PlainVanillaPayoff>& payoff2,
30 ext::shared_ptr<Exercise> exercise2)
31 :
OneAssetOption(payoff1, exercise1), payoff2_(payoff2), exercise2_(
std::move(exercise2)) {}
38 QL_REQUIRE(otherArguments !=
nullptr,
"wrong arguments type");
49 OneAssetOption::arguments::validate();
53 "second exercise date is not later than the first");
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
virtual void setupArguments(PricingEngine::arguments *) const
Base class for options on a single asset.
ext::shared_ptr< Exercise > exercise
Additional arguments for writer-extensible option.
ext::shared_ptr< Payoff > payoff2
ext::shared_ptr< Exercise > exercise2
void validate() const override
WriterExtensibleOption(const ext::shared_ptr< PlainVanillaPayoff > &payoff1, const ext::shared_ptr< Exercise > &exercise1, const ext::shared_ptr< PlainVanillaPayoff > &payoff2, ext::shared_ptr< Exercise > exercise2)
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
returns whether the instrument might have value greater than zero.
ext::shared_ptr< Exercise > exercise2_
ext::shared_ptr< StrikedTypePayoff > payoff2_
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Base class for events associated with a given date.
Writer-extensible option.