票息對價格的影響
你已經看過,改變債券的到期殖利率會大幅影響其價格。改變票息(也就是債券每期支付的金額)也會影響債券價格。接下來你要透過比較高票息和低票息的債券來探索這一點。
numpy_financial 已替你匯入為 npf。
本練習屬於課程
使用 Python 進行債券評價與分析
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Find the price of a 10 year bond with 2% coupon and 4% yield
bond_coupon_2 = -npf.pv(rate=____, nper=____, pmt=____, fv=____)
# Print the result
print("2% Coupon Price: ", ____)