22#include <ql/termstructures/yield/bondhelpers.hpp>
23#include <ql/pricingengines/bond/discountingbondengine.hpp>
24#include <ql/time/schedule.hpp>
25#include <ql/settings.hpp>
26#include <ql/utilities/null_deleter.hpp>
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.");
85 const std::vector<Rate>& coupons,
89 const Date& issueDate,
91 const Period& exCouponPeriod,
94 bool exCouponEndOfMonth,
97 ext::shared_ptr<
Bond>(
99 coupons, dayCounter, paymentConvention,
100 redemption, issueDate, paymentCalendar,
101 exCouponPeriod, exCouponCalendar,
102 exCouponConvention, exCouponEndOfMonth)),
119 const bool growthOnly,
121 const Period& observationLag,
122 const ext::shared_ptr<ZeroInflationIndex>& cpiIndex,
125 const std::vector<Rate>& fixedRate,
128 const Date& issueDate,
130 const Period& exCouponPeriod,
133 bool exCouponEndOfMonth,
136 ext::shared_ptr<
Bond>(
137 new
CPIBond(settlementDays, faceAmount, growthOnly, baseCPI,
138 observationLag, cpiIndex, observationInterpolation,
139 schedule, fixedRate, accrualDayCounter, paymentConvention,
140 issueDate, paymentCalendar, exCouponPeriod, exCouponCalendar,
141 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
ext::shared_ptr< CPIBond > cpiBond_
void accept(AcyclicVisitor &) override
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, const 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)
FixedRateBondHelper(const Handle< Quote > &price, Natural settlementDays, Real faceAmount, const 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)
void accept(AcyclicVisitor &) override
ext::shared_ptr< FixedRateBond > fixedRateBond_
Shared handle to an observable.
Visitor for a specific class
virtual void visit(T &)=0
Interest-rate term structure.
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
InterpolationType
when you observe an index, how do you interpolate between fixings?