21#include <ql/cashflows/couponpricer.hpp>
22#include <ql/cashflows/fixedratecoupon.hpp>
23#include <ql/cashflows/iborcoupon.hpp>
24#include <ql/cashflows/simplecashflow.hpp>
25#include <ql/exercise.hpp>
26#include <ql/instruments/payoffs.hpp>
27#include <ql/pricingengines/bond/bondfunctions.hpp>
29#include <ql/utilities/null_deleter.hpp>
35Ascot::Ascot(Option::Type callPut,
const ext::shared_ptr<Exercise>& exercise,
const Real& bondQuantity,
36 const ext::shared_ptr<ConvertibleBond2>& bond,
const Leg& fundingLeg)
37 : callPut_(callPut), exercise_(exercise), bondQuantity_(bondQuantity),
bond_(bond), fundingLeg_(fundingLeg) {
40 bond_->alwaysForwardNotifications();
42 registerWith(Settings::instance().evaluationDate());
45 if (
auto lazy = QuantLib::ext::dynamic_pointer_cast<LazyObject>(c))
46 lazy->alwaysForwardNotifications();
54 QL_REQUIRE(
arguments != 0,
"wrong argument type");
64 QL_REQUIRE(
exercise,
"exercise not set");
65 QL_REQUIRE(
bond,
"convertible bond is not set");
66 QL_REQUIRE(!
fundingLeg.empty(),
"no funding leg provided");
68 QL_REQUIRE(
fundingLeg[i],
"null cash flow provided");
ext::shared_ptr< ConvertibleBond2 > bond
ext::shared_ptr< Exercise > exercise
void validate() const override
Ascot(Option::Type callPut, const ext::shared_ptr< Exercise > &exercise, const Real &bondQuantity, const ext::shared_ptr< ConvertibleBond2 > &bond, const Leg &fundingLeg)
ext::shared_ptr< ConvertibleBond2 > bond_
void setupArguments(PricingEngine::arguments *) const override
ext::shared_ptr< Exercise > exercise_