26#include <ql/handle.hpp>
27#include <ql/index.hpp>
28#include <ql/indexes/interestrateindex.hpp>
29#include <ql/instruments/bond.hpp>
30#include <ql/termstructures/defaulttermstructure.hpp>
31#include <ql/termstructures/yieldtermstructure.hpp>
32#include <ql/time/calendar.hpp>
33#include <ql/time/calendars/nullcalendar.hpp>
34#include <ql/time/daycounters/simpledaycounter.hpp>
35#include <ql/cashflows/floatingratecoupon.hpp>
36#include <ql/cashflows/couponpricer.hpp>
42class DiscountingRiskyBondEngine;
90 const Calendar&
fixingCalendar = NullCalendar(),
const QuantLib::ext::shared_ptr<QuantLib::Bond>&
bond =
nullptr,
91 const Handle<YieldTermStructure>&
discountCurve = Handle<YieldTermStructure>(),
92 const Handle<DefaultProbabilityTermStructure>&
defaultCurve = Handle<DefaultProbabilityTermStructure>(),
95 const Handle<YieldTermStructure>&
incomeCurve = Handle<YieldTermStructure>(),
99 const double bidAskAdjustment = 0.0,
const bool bondIssueDateFallback =
false);
103 std::string
name()
const override;
106 Real
fixing(
const Date& fixingDate,
bool forecastTodaysFixing =
false)
const override;
117 Rate
pastFixing(
const Date& fixingDate)
const;
125 QuantLib::ext::shared_ptr<QuantLib::Bond>
bond()
const {
return bond_; }
141 QuantLib::ext::shared_ptr<QuantLib::Bond>
bond_;
164 const QuantLib::ext::shared_ptr<QuantLib::Bond>&
bond =
nullptr,
165 const Handle<YieldTermStructure>&
discountCurve = Handle<YieldTermStructure>(),
166 const Handle<DefaultProbabilityTermStructure>&
defaultCurve = Handle<DefaultProbabilityTermStructure>(),
168 const Handle<YieldTermStructure>&
incomeCurve = Handle<YieldTermStructure>(),
175 std::string
name()
const override;
202 const std::string& familyName,
204 Natural settlementDays = 0,
205 Currency currency = Currency(),
206 Calendar fixingCalendar = NullCalendar(),
207 DayCounter dayCounter = SimpleDayCounter(),
212 ext::shared_ptr<Bond>
bond =
nullptr,
214 Compounding compounding = Compounded,
215 Frequency frequency = Annual,
216 Real accuracy = 1.0e-8,
217 Size maxEvaluations = 100,
219 QuantLib::Bond::Price::Type priceType = QuantLib::Bond::Price::Clean)
220 : InterestRateIndex(familyName, tenor, settlementDays, currency, fixingCalendar, dayCounter),
224 std::ostringstream o;
225 o << familyName_ <<
"-" << tenor_;
235 Date
maturityDate(
const Date& valueDate)
const override;
247 const ext::shared_ptr<Bond>&
bond()
const {
return bond_; }
const QuantLib::Date & expiryDate() const
std::string name() const override
Rate forecastFixing(const Date &fixingDate) const override
const std::string & securityName() const
virtual Rate forecastFixing(const Date &fixingDate) const
bool conditionalOnSurvival_
Handle< YieldTermStructure > discountCurve_
Handle< Quote > recoveryRate() const
double priceQuoteBaseValue() const
double priceQuoteBaseValue_
Handle< YieldTermStructure > incomeCurve_
std::string securityName_
Calendar fixingCalendar() const override
Handle< YieldTermStructure > discountCurve() const
bool conditionalOnSurvival() const
Handle< DefaultProbabilityTermStructure > defaultCurve() const
Handle< YieldTermStructure > incomeCurve() const
bool bondIssueDateFallback_
PriceQuoteMethod priceQuoteMethod_
Rate pastFixing(const Date &fixingDate) const
std::string name() const override
Handle< Quote > securitySpread_
Handle< Quote > securitySpread() const
QuantLib::ext::shared_ptr< QuantLib::Bond > bond() const
Handle< DefaultProbabilityTermStructure > defaultCurve_
bool isValidFixingDate(const Date &fixingDate) const override
QuantLib::ext::shared_ptr< DiscountingRiskyBondEngine > vanillaBondEngine_
PriceQuoteMethod priceQuoteMethod() const
QuantLib::ext::shared_ptr< QuantLib::Bond > bond_
Handle< Quote > recoveryRate_
Real fixing(const Date &fixingDate, bool forecastTodaysFixing=false) const override
Constant Maturity Bond Index.
Bond::Price::Type priceType_
const ext::shared_ptr< Bond > & bond() const
ConstantMaturityBondIndex(const std::string &familyName, const Period &tenor, Natural settlementDays=0, Currency currency=Currency(), Calendar fixingCalendar=NullCalendar(), DayCounter dayCounter=SimpleDayCounter(), BusinessDayConvention convention=Following, bool endOfMonth=false, ext::shared_ptr< Bond > bond=nullptr, Compounding compounding=Compounded, Frequency frequency=Annual, Real accuracy=1.0e-8, Size maxEvaluations=100, Real guess=0.05, QuantLib::Bond::Price::Type priceType=QuantLib::Bond::Price::Clean)
std::string creditCurveId_
Date maturityDate(const Date &valueDate) const override
BusinessDayConvention convention_
BusinessDayConvention convention() const
ext::shared_ptr< Bond > bond_
Rate forecastFixing(const Date &fixingDate) const override