Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ConstantMaturityBondIndex Class Reference

Constant Maturity Bond Index. More...

#include <qle/indexes/bondindex.hpp>

+ Inheritance diagram for ConstantMaturityBondIndex:
+ Collaboration diagram for ConstantMaturityBondIndex:

Public Member Functions

 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)
 
InterestRateIndex interface
Date maturityDate (const Date &valueDate) const override
 
Fixing calculations
Rate forecastFixing (const Date &fixingDate) const override
 

Inspectors

BusinessDayConvention convention_
 
bool endOfMonth_
 
ext::shared_ptr< Bond > bond_
 
Compounding compounding_
 
Frequency frequency_
 
Real accuracy_
 
Size maxEvaluations_
 
Real guess_
 
Bond::Price::Type priceType_
 
Date bondStartDate_
 
std::string securityId_
 
std::string creditCurveId_
 
BusinessDayConvention convention () const
 
bool endOfMonth () const
 
const ext::shared_ptr< Bond > & bond () const
 

Detailed Description

Constant Maturity Bond Index.

The purpose of this object is converting generic bond prices into yields and to use the yields as fixings in the context of floating rate coupons

Definition at line 199 of file bondindex.hpp.

Constructor & Destructor Documentation

◆ ConstantMaturityBondIndex()

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 
)

Definition at line 201 of file bondindex.hpp.

220 : InterestRateIndex(familyName, tenor, settlementDays, currency, fixingCalendar, dayCounter),
222 bond_(bond), compounding_(compounding), frequency_(frequency),
223 accuracy_(accuracy), maxEvaluations_(maxEvaluations), guess_(guess), priceType_(priceType) {
224 std::ostringstream o;
225 o << familyName_ << "-" << tenor_;
226 name_ = o.str();
227 if (bond_) {
228 registerWith(bond_);
229 bondStartDate_ = bond->startDate();
230 }
231 }
const ext::shared_ptr< Bond > & bond() const
Definition: bondindex.hpp:247
BusinessDayConvention convention_
Definition: bondindex.hpp:251
BusinessDayConvention convention() const
Definition: bondindex.hpp:245
ext::shared_ptr< Bond > bond_
Definition: bondindex.hpp:253
+ Here is the call graph for this function:

Member Function Documentation

◆ maturityDate()

Date maturityDate ( const Date &  valueDate) const
override

Definition at line 207 of file bondindex.cpp.

207 {
208 // same as IborIndex
209 return fixingCalendar().advance(valueDate, tenor_, convention_, endOfMonth_);
210}

◆ forecastFixing()

Rate forecastFixing ( const Date &  fixingDate) const
override

Definition at line 212 of file bondindex.cpp.

212 {
213 QL_REQUIRE(bond_, "cannot forecast ConstantMaturityBondIndex fixing, because underlying bond not set");
214 QL_REQUIRE(fixingDate == bondStartDate_, "bond yield fixing only available at bond start date, "
215 << io::iso_date(fixingDate) << " != " << io::iso_date(bondStartDate_));
216 return bond_->yield(dayCounter_, compounding_, frequency_, accuracy_, maxEvaluations_, guess_, priceType_);
217}

◆ convention()

BusinessDayConvention convention ( ) const

Definition at line 245 of file bondindex.hpp.

245{ return convention_; }

◆ endOfMonth()

bool endOfMonth ( ) const

Definition at line 246 of file bondindex.hpp.

246{ return endOfMonth_; }

◆ bond()

const ext::shared_ptr< Bond > & bond ( ) const

Definition at line 247 of file bondindex.hpp.

247{ return bond_; }
+ Here is the caller graph for this function:

Member Data Documentation

◆ convention_

BusinessDayConvention convention_
private

Definition at line 251 of file bondindex.hpp.

◆ endOfMonth_

bool endOfMonth_
private

Definition at line 252 of file bondindex.hpp.

◆ bond_

ext::shared_ptr<Bond> bond_
private

Definition at line 253 of file bondindex.hpp.

◆ compounding_

Compounding compounding_
private

Definition at line 254 of file bondindex.hpp.

◆ frequency_

Frequency frequency_
private

Definition at line 255 of file bondindex.hpp.

◆ accuracy_

Real accuracy_
private

Definition at line 256 of file bondindex.hpp.

◆ maxEvaluations_

Size maxEvaluations_
private

Definition at line 257 of file bondindex.hpp.

◆ guess_

Real guess_
private

Definition at line 258 of file bondindex.hpp.

◆ priceType_

Bond::Price::Type priceType_
private

Definition at line 259 of file bondindex.hpp.

◆ bondStartDate_

Date bondStartDate_
private

Definition at line 260 of file bondindex.hpp.

◆ securityId_

std::string securityId_
private

Definition at line 261 of file bondindex.hpp.

◆ creditCurveId_

std::string creditCurveId_
private

Definition at line 262 of file bondindex.hpp.