quantlib.instruments.bond.Bond

class Bond

Bases: Instrument

Base bond class

Warning

Most methods assume that the cash flows are stored sorted by date, the redemption(s) being after any cash flow at the same date. In particular, if there’s one single redemption, it must be the last cash flow,

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

accrued_amount(self, Date date=Date)

Returns the bond accrued amount at the given date

bond_yield(self, Real price, DayCounter dc, ...)

Return the yield given a price and settlement date

notional(self, Date date=Date)

set_pricing_engine(self, PricingEngine engine)

Sets the pricing engine.

settlement_date(self, Date from_date=Date)

Returns the bond settlement date after the given date.

Attributes

calendar

cashflows

cash flow stream as a Leg

clean_price

Bond clean price.

dirty_price

Bond dirty price

is_expired

issue_date

Bond issue date

maturity_date

Bond maturity date

net_present_value

Instrument net present value.

npv

Shortcut to the net_present_value property.

settlement_days

start_date

Bond start date

valuation_date

accrued_amount(self, Date date=Date())

Returns the bond accrued amount at the given date

bond_yield(self, Real price, DayCounter dc, Compounding comp, Frequency freq, Date settlement_date=Date(), Real accuracy=1e-08, Size max_evaluations=100, Real guess=0.5, Type price_type=Price.Clean)

Return the yield given a price and settlement date

The default bond settlement is used if no date is given.

This method is the original Bond.yield method in C++. Python does not allow us to use the yield statement as a method name.

cashflows

cash flow stream as a Leg

clean_price

Bond clean price.

dirty_price

Bond dirty price

issue_date

Bond issue date

maturity_date

Bond maturity date

notional(self, Date date=Date())
settlement_date(self, Date from_date=Date())

Returns the bond settlement date after the given date.

start_date

Bond start date