20#include <ql/event.hpp>
21#include <ql/experimental/exoticoptions/writerextensibleoption.hpp>
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();
50 QL_REQUIRE(
payoff2,
"no second payoff given");
51 QL_REQUIRE(
exercise2,
"no second exercise given");
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_