22#include <ql/instruments/dividendbarrieroption.hpp>
23#include <ql/utilities/dataformatters.hpp>
24#include <ql/exercise.hpp>
32 const ext::shared_ptr<StrikedTypePayoff>& payoff,
33 const ext::shared_ptr<Exercise>& exercise,
34 const std::vector<Date>& dividendDates,
35 const std::vector<Real>& dividends)
36 :
BarrierOption(barrierType, barrier, rebate, payoff, exercise),
44 QL_DEPRECATED_DISABLE_WARNING
46 QL_REQUIRE(
arguments !=
nullptr,
"wrong engine type");
49 QL_DEPRECATED_ENABLE_WARNING
59 QL_REQUIRE(
cashFlow[i]->date() <= exerciseDate,
62 <<
") is later than the exercise date ("
63 << exerciseDate <<
")");
68 switch (arguments_.barrierType) {
71 return underlying < arguments_.barrier;
74 return underlying > arguments_.barrier;
76 QL_FAIL(
"unknown type");
void validate() const override
Barrier option on a single asset.
void setupArguments(PricingEngine::arguments *) const override
DividendSchedule cashFlow
void validate() const override
bool triggered(Real underlying) const
void setupArguments(PricingEngine::arguments *) const override
DividendBarrierOption(Barrier::Type barrierType, Real barrier, Real rebate, const ext::shared_ptr< StrikedTypePayoff > &payoff, const ext::shared_ptr< Exercise > &exercise, const std::vector< Date > ÷ndDates, const std::vector< Real > ÷nds)
DividendSchedule cashFlow_
ext::shared_ptr< Exercise > exercise() const
detail::ordinal_holder ordinal(Size)
outputs naturals as 1st, 2nd, 3rd...
std::size_t Size
size of a container
std::vector< ext::shared_ptr< Dividend > > DividendVector(const std::vector< Date > ÷ndDates, const std::vector< Real > ÷nds)
helper function building a sequence of fixed dividends