Repository navigation
Replies: 1 comment
|
Yes — For Treasuries specifically, use from financepy.products.bonds.bond import Bond
from financepy.products.bonds import get_bond_market_conventions, BondMarkets
from financepy.market.curves import BondBootstrapDiscountCurve
from financepy.utils.date import Date
acc_dc_type, freq_type, spot_days, ex_div_days, cal = get_bond_market_conventions(
BondMarkets.UNITED_STATES
)
today = Date(18, 9, 2024)
settle_dt = today.add_weekdays(spot_days)
bonds = []
clean_prices = []
for issue_dt, maturity_dt, coupon, clean_price in your_par_bond_data:
bond = Bond(
issue_dt, maturity_dt, coupon, freq_type, acc_dc_type,
ex_div_days=ex_div_days, cal_type=cal,
)
bonds.append(bond)
clean_prices.append(clean_price)
curve = BondBootstrapDiscountCurve(settle_dt, bonds, clean_prices)
zero_rates = curve.zero_rate([b.maturity_dt for b in bonds])
One likely source of the "not sure the output is right" feeling: if your par curve has widely spaced maturities, the choice of |
Uh oh!
There was an error while loading. Please reload this page.
Hi, is there a way to derive zero coupon rates from par rates? I have tried but I am not sure the the output I get is right... I am doing this for Tsy bond par rates, not for depo & swap rates. Thanks!!!
All reactions