QuantLib 0.3.9
Getting started
Reference manual
|
#include <ql/Instruments/bond.hpp>
Inheritance diagram for Bond:
[legend]List of all members.
Detailed Description
Base bond class.
Derived classes must fill the unitialized data members.
- Warning:
- Most methods assume that the cashflows are stored sorted by date
- Tests:
- price/yield calculations are cross-checked for consistency.
- price/yield calculations are checked against known good values.
|
Public Member Functions |
|
|
Date | settlementDate () const |
const std::vector< boost::shared_ptr<
CashFlow > > & | cashflows () const |
|
const boost::shared_ptr< CashFlow > & | redemption () const |
|
const Calendar & | calendar () const |
|
BusinessDayConvention | businessDayConvention () const |
|
const DayCounter & | dayCounter () const |
|
Frequency | frequency () const |
|
boost::shared_ptr< YieldTermStructure > | discountCurve () const |
|
| Real | cleanPrice () const |
| | theoretical clean price
|
| Real | dirtyPrice () const |
| | theoretical dirty price
|
| Real | yield (Compounding compounding, Real accuracy=1.0e-8, Size maxEvaluations=100) const |
| | theoretical bond yield
|
| Real | cleanPrice (Rate yield, Compounding compounding, Date settlementDate=Date()) const |
| | clean price given a yield and settlement date
|
| Real | dirtyPrice (Rate yield, Compounding compounding, Date settlementDate=Date()) const |
| | dirty price given a yield and settlement date
|
| Real | yield (Real cleanPrice, Compounding compounding, Date settlementDate=Date(), Real accuracy=1.0e-8, Size maxEvaluations=100) const |
| | yield given a (clean) price and settlement date
|
| Real | cleanPrice (Rate yield, Date settlementDate=Date()) const |
| Real | dirtyPrice (Rate yield, Date settlementDate=Date()) const |
| Real | yield (Real cleanPrice, Date settlementDate=Date(), Real accuracy=1.0e-8, Size maxEvaluations=100) const |
| Real | accruedAmount (Date d=Date()) const |
| | accrued amount at a given date
|
|
bool | isExpired () const |
| | returns whether the instrument is still tradable.
|
Protected Member Functions |
|
| Bond (const DayCounter &dayCount, const Calendar &calendar, BusinessDayConvention businessDayConvention, Integer settlementDays, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >()) |
| void | performCalculations () const |
Protected Attributes |
|
Integer | settlementDays_ |
|
Calendar | calendar_ |
|
BusinessDayConvention | businessDayConvention_ |
|
DayCounter | dayCount_ |
|
Date | issueDate_ |
|
Date | datedDate_ |
|
Date | maturityDate_ |
|
Frequency | frequency_ |
std::vector< boost::shared_ptr<
CashFlow > > | cashFlows_ |
|
boost::shared_ptr< CashFlow > | redemption_ |
|
Handle< YieldTermStructure > | discountCurve_ |
Member Function Documentation
| Real cleanPrice |
( |
|
) |
const |
|
|
|
theoretical clean price
The default bond settlement is used for calculation. |
| Real dirtyPrice |
( |
|
) |
const |
|
|
|
theoretical dirty price
The default bond settlement is used for calculation. |
| Real yield |
( |
Compounding |
compounding, |
|
|
Real |
accuracy = 1.0e-8, |
|
|
Size |
maxEvaluations = 100 |
|
) |
const |
|
|
|
theoretical bond yield
The default bond settlement and theoretical price are used for calculation. |
| Real cleanPrice |
( |
Rate |
yield, |
|
|
Compounding |
compounding, |
|
|
Date |
settlementDate = Date() |
|
) |
const |
|
|
|
clean price given a yield and settlement date
The default bond settlement is used if no date is given. |
| Real dirtyPrice |
( |
Rate |
yield, |
|
|
Compounding |
compounding, |
|
|
Date |
settlementDate = Date() |
|
) |
const |
|
|
|
dirty price given a yield and settlement date
The default bond settlement is used if no date is given. |
| Real yield |
( |
Real |
cleanPrice, |
|
|
Compounding |
compounding, |
|
|
Date |
settlementDate = Date(), |
|
|
Real |
accuracy = 1.0e-8, |
|
|
Size |
maxEvaluations = 100 |
|
) |
const |
|
|
|
yield given a (clean) price and settlement date
The default bond settlement is used if no date is given. |
|
|
accrued amount at a given date
The default bond settlement is used if no date is given. |
| void performCalculations |
( |
|
) |
const [protected, virtual] |
|
|
|
In case a pricing engine is not used, this method must be overridden to perform the actual calculations and set any needed results. In case a pricing engine is used, the default implementation can be used.
Reimplemented from Instrument. |
|