Bond Index. More...
#include <qle/indexes/bondindex.hpp>
Public Types | |
enum class | PriceQuoteMethod { PercentageOfPar , CurrencyPerUnit } |
Public Member Functions | |
BondIndex (const std::string &securityName, const bool dirty=false, const bool relative=true, const Calendar &fixingCalendar=NullCalendar(), const QuantLib::ext::shared_ptr< QuantLib::Bond > &bond=nullptr, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const Handle< DefaultProbabilityTermStructure > &defaultCurve=Handle< DefaultProbabilityTermStructure >(), const Handle< Quote > &recoveryRate=Handle< Quote >(), const Handle< Quote > &securitySpread=Handle< Quote >(), const Handle< YieldTermStructure > &incomeCurve=Handle< YieldTermStructure >(), const bool conditionalOnSurvival=true, const Date &issueDate=Date(), const PriceQuoteMethod priceQuoteMethod=PriceQuoteMethod::PercentageOfPar, const double priceQuoteBaseValue=1.0, const bool isInflationLinked=false, const double bidAskAdjustment=0.0, const bool bondIssueDateFallback=false) | |
Index interface | |
std::string | name () const override |
Calendar | fixingCalendar () const override |
bool | isValidFixingDate (const Date &fixingDate) const override |
Real | fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override |
Observer interface | |
void | update () override |
Fixing calculations | |
virtual Rate | forecastFixing (const Date &fixingDate) const |
Rate | pastFixing (const Date &fixingDate) const |
Inspectors | |
std::string | securityName_ |
bool | dirty_ |
bool | relative_ |
Calendar | fixingCalendar_ |
QuantLib::ext::shared_ptr< QuantLib::Bond > | bond_ |
Handle< YieldTermStructure > | discountCurve_ |
Handle< DefaultProbabilityTermStructure > | defaultCurve_ |
Handle< Quote > | recoveryRate_ |
Handle< Quote > | securitySpread_ |
Handle< YieldTermStructure > | incomeCurve_ |
bool | conditionalOnSurvival_ |
Date | issueDate_ |
PriceQuoteMethod | priceQuoteMethod_ |
double | priceQuoteBaseValue_ |
bool | isInflationLinked_ |
double | bidAskAdjustment_ |
QuantLib::ext::shared_ptr< DiscountingRiskyBondEngine > | vanillaBondEngine_ |
bool | bondIssueDateFallback_ = false |
const std::string & | securityName () const |
bool | dirty () const |
bool | relative () const |
QuantLib::ext::shared_ptr< QuantLib::Bond > | bond () const |
Handle< YieldTermStructure > | discountCurve () const |
Handle< DefaultProbabilityTermStructure > | defaultCurve () const |
Handle< Quote > | recoveryRate () const |
Handle< Quote > | securitySpread () const |
Handle< YieldTermStructure > | incomeCurve () const |
bool | conditionalOnSurvival () const |
Date | issueDate () const |
PriceQuoteMethod | priceQuoteMethod () const |
double | priceQuoteBaseValue () const |
Bond Index.
Definition at line 46 of file bondindex.hpp.
|
strong |
Enumerator | |
---|---|
PercentageOfPar | |
CurrencyPerUnit |
Definition at line 48 of file bondindex.hpp.
BondIndex | ( | const std::string & | securityName, |
const bool | dirty = false , |
||
const bool | relative = true , |
||
const Calendar & | fixingCalendar = NullCalendar() , |
||
const QuantLib::ext::shared_ptr< QuantLib::Bond > & | bond = nullptr , |
||
const Handle< YieldTermStructure > & | discountCurve = Handle<YieldTermStructure>() , |
||
const Handle< DefaultProbabilityTermStructure > & | defaultCurve = Handle<DefaultProbabilityTermStructure>() , |
||
const Handle< Quote > & | recoveryRate = Handle<Quote>() , |
||
const Handle< Quote > & | securitySpread = Handle<Quote>() , |
||
const Handle< YieldTermStructure > & | incomeCurve = Handle<YieldTermStructure>() , |
||
const bool | conditionalOnSurvival = true , |
||
const Date & | issueDate = Date() , |
||
const PriceQuoteMethod | priceQuoteMethod = PriceQuoteMethod::PercentageOfPar , |
||
const double | priceQuoteBaseValue = 1.0 , |
||
const bool | isInflationLinked = false , |
||
const double | bidAskAdjustment = 0.0 , |
||
const bool | bondIssueDateFallback = false |
||
) |
The values that this index return are of the form
The first form is returned if the flag relative in the ctor is set to true, the second if this flag is set to false.
The fixing projection (fixingDate > today) assumes that the given bond is vanilla, i.e. its present value can be calculated by discounting the cashflows retrieved with Bond::cashflows().
If the bond has a pricing engine attached and today's fixing is projected, the pricing engine's result will be used. Otherwise today's fixing will be calculated as projected fixings for dates > today, i.e. by simply discounting the bond's cashflows.
If no bond is given, only historical fixings are returned by the index and only the clean price mode and relative price mode are supported respectively. Otherwise an exception is thrown whenever a fixing is requested from the index.
To compute projected fixings for dates > today, a discountCurve is required. The other quotes and curves are optional and default as follows:
If conditionalOnSurvival is set to true, a projected fixing will be conditional on survival until the associated bond settlement date, otherwise it will include the default probability between today and the settlement date.
If priceQuoteMethod = CurrencyPerUnit, a fixing in the fixing history will be divided by priceQuoteBaseValue before returning it.
Definition at line 29 of file bondindex.cpp.
|
override |
|
override |
|
override |
Definition at line 61 of file bondindex.cpp.
|
override |
Definition at line 65 of file bondindex.cpp.
|
override |
Definition at line 63 of file bondindex.cpp.
|
virtual |
Reimplemented in BondFuturesIndex.
Definition at line 92 of file bondindex.cpp.
Real pastFixing | ( | const Date & | fixingDate | ) | const |
Definition at line 134 of file bondindex.cpp.
const std::string & securityName | ( | ) | const |
bool dirty | ( | ) | const |
bool relative | ( | ) | const |
QuantLib::ext::shared_ptr< QuantLib::Bond > bond | ( | ) | const |
Handle< YieldTermStructure > discountCurve | ( | ) | const |
Handle< DefaultProbabilityTermStructure > defaultCurve | ( | ) | const |
Handle< Quote > recoveryRate | ( | ) | const |
Handle< Quote > securitySpread | ( | ) | const |
Handle< YieldTermStructure > incomeCurve | ( | ) | const |
bool conditionalOnSurvival | ( | ) | const |
Date issueDate | ( | ) | const |
Definition at line 132 of file bondindex.hpp.
PriceQuoteMethod priceQuoteMethod | ( | ) | const |
Definition at line 133 of file bondindex.hpp.
double priceQuoteBaseValue | ( | ) | const |
Definition at line 134 of file bondindex.hpp.
|
protected |
Definition at line 138 of file bondindex.hpp.
|
protected |
Definition at line 139 of file bondindex.hpp.
|
protected |
Definition at line 139 of file bondindex.hpp.
|
protected |
Definition at line 140 of file bondindex.hpp.
|
protected |
Definition at line 141 of file bondindex.hpp.
|
protected |
Definition at line 142 of file bondindex.hpp.
|
protected |
Definition at line 143 of file bondindex.hpp.
|
protected |
Definition at line 144 of file bondindex.hpp.
|
protected |
Definition at line 145 of file bondindex.hpp.
|
protected |
Definition at line 146 of file bondindex.hpp.
|
protected |
Definition at line 147 of file bondindex.hpp.
|
protected |
Definition at line 148 of file bondindex.hpp.
|
protected |
Definition at line 149 of file bondindex.hpp.
|
protected |
Definition at line 150 of file bondindex.hpp.
|
protected |
Definition at line 151 of file bondindex.hpp.
|
protected |
Definition at line 152 of file bondindex.hpp.
|
protected |
Definition at line 153 of file bondindex.hpp.
|
protected |
Definition at line 154 of file bondindex.hpp.