25 QL_REQUIRE(
barrier().levels().
size() == 2,
"Invalid number of barrier levels. Must have two.");
26 QL_REQUIRE(
barrier().style().empty() ||
barrier().style() ==
"American",
"Only American barrier style supported");
29QuantLib::ext::shared_ptr<QuantLib::PricingEngine>
31 const QuantLib::Date& expiryDate,
const QuantLib::Date& paymentDate) {
33 QuantLib::ext::shared_ptr<EngineBuilder> builder = ef->builder(
"EquityOption");
34 QL_REQUIRE(builder,
"No builder found for EquityOption");
36 QuantLib::ext::shared_ptr<EquityEuropeanOptionEngineBuilder> eqOptBuilder =
37 QuantLib::ext::dynamic_pointer_cast<EquityEuropeanOptionEngineBuilder>(builder);
38 QL_REQUIRE(eqOptBuilder,
"No eqOptBuilder found");
45QuantLib::ext::shared_ptr<QuantLib::PricingEngine>
47 const QuantLib::Date& expiryDate,
const QuantLib::Date& paymentDate) {
49 QuantLib::ext::shared_ptr<EngineBuilder> builder = ef->builder(
tradeType_);
50 QL_REQUIRE(builder,
"No builder found for " <<
tradeType_);
52 QuantLib::ext::shared_ptr<EquityDoubleBarrierOptionEngineBuilder> eqBarrierOptBuilder =
53 QuantLib::ext::dynamic_pointer_cast<EquityDoubleBarrierOptionEngineBuilder>(builder);
54 QL_REQUIRE(eqBarrierOptBuilder,
"No eqBarrierOptBuilder found");
Engine builder for equity options.
const BarrierData & barrier() const
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > vanillaPricingEngine(const QuantLib::ext::shared_ptr< EngineFactory > &ef, const QuantLib::Date &expiryDate, const QuantLib::Date &paymentDate=QuantLib::Date()) override
create the pricing engines
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > barrierPricingEngine(const QuantLib::ext::shared_ptr< EngineFactory > &ef, const QuantLib::Date &expiryDate, const QuantLib::Date &paymentDate=Date()) override
void checkBarriers() override
check validity of barriers
Currency tradeCurrency() override
const string & equityName() const
void setSensitivityTemplate(const EngineBuilder &builder)
Equity Double Barrier Option data model and serialization.
Size size(const ValueType &v)
Serializable Credit Default Swap.