28 QL_REQUIRE(
barrier().levels().
size() == 1,
"Invalid number of barrier levels");
29 QL_REQUIRE(
barrier().style().empty() ||
barrier().style() ==
"American",
"Only american barrier style suppported");
33 const QuantLib::Date& expiryDate,
const QuantLib::Date& paymentDate) {
35 QuantLib::ext::shared_ptr<EngineBuilder> builder = ef->builder(
"EquityOption");
36 QL_REQUIRE(builder,
"No builder found for EquityOption");
38 QuantLib::ext::shared_ptr<EquityEuropeanOptionEngineBuilder> eqOptBuilder =
39 QuantLib::ext::dynamic_pointer_cast<EquityEuropeanOptionEngineBuilder>(builder);
40 QL_REQUIRE(eqOptBuilder,
"No eqOptBuilder found");
47QuantLib::ext::shared_ptr<QuantLib::PricingEngine>
49 const QuantLib::Date& expiryDate,
const QuantLib::Date& paymentDate) {
51 QuantLib::ext::shared_ptr<EngineBuilder> builder = ef->builder(
tradeType_);
52 QL_REQUIRE(builder,
"No builder found for " <<
tradeType_);
54 QuantLib::ext::shared_ptr<EquityBarrierOptionEngineBuilder> eqBarrierOptBuilder =
55 QuantLib::ext::dynamic_pointer_cast<EquityBarrierOptionEngineBuilder>(builder);
56 QL_REQUIRE(eqBarrierOptBuilder,
"No eqBarrierOptBuilder found");
Engine builder for equity options.
const BarrierData & barrier() const
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > barrierPricingEngine(const QuantLib::ext::shared_ptr< EngineFactory > &ef, const QuantLib::Date &expiryDate, const QuantLib::Date &paymentDate=QuantLib::Date()) override
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
void checkBarriers() override
check validity of barriers
Currency tradeCurrency() override
const string & equityName() const
void setSensitivityTemplate(const EngineBuilder &builder)
Equity Barrier Option data model and serialization.
Size size(const ValueType &v)
Serializable Credit Default Swap.