31 const ext::shared_ptr<Bond>& bond,
33 :
RateHelper(price), bond_(ext::make_shared<
Bond>(*bond)), priceType_(priceType) {
40 bond_->setPricingEngine(
48 ext::shared_ptr<YieldTermStructure>(
t,
null_deleter()),
false);
60 return bond_->cleanPrice();
64 return bond_->dirtyPrice();
68 QL_FAIL(
"This price type isn't implemented.");
88 const std::vector<Rate>& coupons,
92 const Date& issueDate,
94 const Period& exCouponPeriod,
97 bool exCouponEndOfMonth,
100 ext::make_shared<
FixedRateBond>(settlementDays, faceAmount,
std::move(schedule),
101 coupons, dayCounter, paymentConvention,
102 redemption, issueDate, paymentCalendar,
103 exCouponPeriod, exCouponCalendar,
104 exCouponConvention, exCouponEndOfMonth),
124 const bool growthOnly,
126 const Period& observationLag,
127 const ext::shared_ptr<ZeroInflationIndex>& cpiIndex,
130 const std::vector<Rate>& fixedRate,
133 const Date& issueDate,
135 const Period& exCouponPeriod,
138 bool exCouponEndOfMonth,
141 ext::make_shared<
CPIBond>(settlementDays, faceAmount, growthOnly, baseCPI,
142 observationLag, cpiIndex, observationInterpolation,
143 std::move(schedule), fixedRate, accrualDayCounter, paymentConvention,
144 issueDate, paymentCalendar, exCouponPeriod, exCouponCalendar,
145 exCouponConvention, exCouponEndOfMonth),
degenerate base class for the Acyclic Visitor pattern
Bond helper for curve bootstrap.
Bond::Price::Type priceType_
void setTermStructure(YieldTermStructure *) override
RelinkableHandle< YieldTermStructure > termStructureHandle_
void accept(AcyclicVisitor &) override
Real impliedQuote() const override
BondHelper(const Handle< Quote > &price, const ext::shared_ptr< Bond > &bond, Bond::Price::Type priceType=Bond::Price::Clean)
ext::shared_ptr< Bond > bond_
Base helper class for bootstrapping.
virtual void accept(AcyclicVisitor &)
virtual void setTermStructure(TS *)
sets the term structure to be used for pricing
void accept(AcyclicVisitor &) override
QL_DEPRECATED_ENABLE_WARNING CPIBondHelper(const Handle< Quote > &price, Natural settlementDays, Real faceAmount, bool growthOnly, Real baseCPI, const Period &observationLag, const ext::shared_ptr< ZeroInflationIndex > &cpiIndex, CPI::InterpolationType observationInterpolation, Schedule schedule, const std::vector< Rate > &fixedRate, const DayCounter &accrualDayCounter, BusinessDayConvention paymentConvention=Following, const Date &issueDate=Date(), const Calendar &paymentCalendar=Calendar(), const Period &exCouponPeriod=Period(), const Calendar &exCouponCalendar=Calendar(), BusinessDayConvention exCouponConvention=Unadjusted, bool exCouponEndOfMonth=false, Bond::Price::Type priceType=Bond::Price::Clean)
void accept(AcyclicVisitor &) override
QL_DEPRECATED_ENABLE_WARNING FixedRateBondHelper(const Handle< Quote > &price, Natural settlementDays, Real faceAmount, Schedule schedule, const std::vector< Rate > &coupons, const DayCounter &dayCounter, BusinessDayConvention paymentConv=Following, Real redemption=100.0, const Date &issueDate=Date(), const Calendar &paymentCalendar=Calendar(), const Period &exCouponPeriod=Period(), const Calendar &exCouponCalendar=Calendar(), BusinessDayConvention exCouponConvention=Unadjusted, bool exCouponEndOfMonth=false, Bond::Price::Type priceType=Bond::Price::Clean)
Shared handle to an observable.
Visitor for a specific class
virtual void visit(T &)=0
Interest-rate term structure.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
empty deleter for shared_ptr
ext::shared_ptr< BlackVolTermStructure > v
#define QL_DEPRECATED_DISABLE_WARNING
#define QL_DEPRECATED_ENABLE_WARNING
global repository for run-time library settings
InterpolationType
when you observe an index, how do you interpolate between fixings?