FinancePy

FinancePy API Reference

Bond Zero

financepy.products.bonds.bond_zero

Classes

BondZero

BondZero(issue_dt: financepy.utils.date.Date, maturity_dt: financepy.utils.date.Date, issue_price: float, curve_dc_type: financepy.utils.day_count.DayCountTypes = <DayCountTypes.ACT_365F: 7>)
A zero cpn bond is a bond which doesn't pay any periodic payments. Instead, it is issued at a discount. The entire face value of the bond is paid out at maturity. It is issued as a deep discount bond. There is a special convention for accrued interest in which Accrued_interest = (par - issue price) * D where D = (settle_dt - issue_dt)/(maturity_dt - issue_dt).

Methods

dirty_price_from_ytm

dirty_price_from_ytm(self, settle_dt: financepy.utils.date.Date, ytm: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)

No description available.

principal

principal(self, settle_dt: financepy.utils.date.Date, ytm: float, face: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Return BBG principal value for a given face amount.

accretion_yield

accretion_yield(self, settle_dt: financepy.utils.date.Date, clean_price)
Return average annual accretion yield from settlement.

current_yield

current_yield(self, clean_price)
Calculate the current yield of the bond which is the cpn divided by the clean price (not the full price). The cpn of a zero cpn bond is defined as: (par - issue_price) / tenor

yield_to_maturity

yield_to_maturity(self, settle_dt: financepy.utils.date.Date, clean_price: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Return YTM from clean price for a zero coupon bond.

discount_rate

discount_rate(self, settle_dt: financepy.utils.date.Date, clean_price: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Return discount rate for a zero coupon bond.

accrued_interest

accrued_interest(self, settle_dt: financepy.utils.date.Date, face: float = 100.0)
Return accrued discount on a zero coupon bond. Convention: accrued = face * (par - issue_price) / par * (settle_dt - issue_dt) / (maturity_dt - issue_dt)

dollar_duration

dollar_duration(self, settle_dt: (<class 'financepy.utils.date.Date'>, typing.List), ytm: (<class 'float'>, typing.List), convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Calculate dollar duration from a 1bp bumped-yield DV01. Dollar duration is the dirty-price change for a 100bp change in yield, approximated as: dollar_duration = 10000 * DV01 where DV01 is the positive dirty-price change for a +1bp yield shift.

dv01

dv01(self, settle_dt: financepy.utils.date.Date, ytm: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Change in dirty price for a +1 basis point increase in yield. Bloomberg-style DV01 / PV01 is positive for a long fixed-rate bond.

macaulay_duration

macaulay_duration(self, settle_dt: financepy.utils.date.Date, ytm: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Return Macaulay duration of a zero coupon bond.

modified_duration

modified_duration(self, settle_dt: financepy.utils.date.Date, ytm: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Calculate the modified duration of the bondon a settlement date given its yield to maturity.

convexity_from_ytm

convexity_from_ytm(self, settle_dt: financepy.utils.date.Date, ytm: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Calculate the bond convexity from the yield to maturity. This function is vectorised with respect to the yield input.

clean_price_from_ytm

clean_price_from_ytm(self, settle_dt: financepy.utils.date.Date, ytm: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Calculate the clean price of a zero coupon bond from its YTM.

clean_price_from_discount_curve

clean_price_from_discount_curve(self, settle_dt: financepy.utils.date.Date, discount_curve: financepy.market.curves.discount_curve.DiscountCurve)
Calculate the clean bond value using some discount curve to present-value the bond's cash flows back to the curve anchor date and not to the settlement date.

dirty_price_from_discount_curve

dirty_price_from_discount_curve(self, settle_dt: financepy.utils.date.Date, discount_curve: financepy.market.curves.discount_curve.DiscountCurve)
Return dirty price per 100 nominal using a discount curve.

bond_payments

bond_payments(self, settle_dt: financepy.utils.date.Date, face: float)
Return the zero bond redemption payment.

print_payments

print_payments(self, settle_dt: financepy.utils.date.Date, face: float = 100.0)
Print a list of the unadjusted cpn payment dates used in analytic calculations for the bond.

dirty_price_from_survival_curve

dirty_price_from_survival_curve(self, settle_dt: financepy.utils.date.Date, discount_curve: financepy.market.curves.discount_curve.DiscountCurve, survival_curve: financepy.market.curves.discount_curve.DiscountCurve, recovery_rate: float)
Return risky dirty price per 100 nominal for a zero coupon bond.

clean_price_from_survival_curve

clean_price_from_survival_curve(self, settle_dt: financepy.utils.date.Date, discount_curve: financepy.market.curves.discount_curve.DiscountCurve, survival_curve: financepy.market.curves.discount_curve.DiscountCurve, recovery_rate: float)
Return risky clean price per 100 nominal for a zero coupon bond.

calc_ror

calc_ror(self, begin_dt: financepy.utils.date.Date, end_dt: financepy.utils.date.Date, begin_ytm: float, end_ytm: float, convention: financepy.utils.global_types.YTMCalcType = <YTMCalcType.ZERO: 0>)
Return annualised simple return, IRR, and PnL for a zero coupon bond.

Functions

validate_yield

validate_yield(ytm)

No description available.

Generated automatically from the FinancePy source code. Do not edit this file manually.