用 Python 进行债券定价与分析
Joshua Mayhew
Options Trader
久期 = 收益率变动 1% 时债券价格的百分比变动
美元久期 = 收益率变动 1% 时债券价格的美元变动:
告诉我们利率变动会赚/亏多少钱
$ \text{Dollar Duration} = \text{Duration} \times \text{Bond Price} \times 0.01$
DV01 = 收益率变动 0.01% 时债券价格的美元变动。
0.01% = 1% 的 1% = 1 个基点
"dollar value of one basis point"的缩写
$ \text{DV01} = \text{Duration} \times \text{Bond Price} \times 0.0001$
某债券价格 92.28 美元,久期 7.98%:
dollar_duration = 92.28 * 7.98 * 0.01
print("Dollar Duration: ", dollar_duration)
Dollar Duration: 7.36
DV01 = 92.28 * 7.98 * 0.0001
print("DV01: ", DV01)
DV01: 0.0736
portfolio_dv01 = 10000
bond_dv01 = 0.0736
hedge_quantity = portfolio_dv01 / bond_dv01
print("Number of bonds to sell: ", hedge_quantity)
Number of bonds to sell: 135,869
bond_price = 92.28
hedge_amount = hedge_quantity * bond_price
print("Dollar amount to sell: USD", hedge_amount)
Dollar amount to sell: USD 12,538,043
$ \text{Price Change} = -100 \times \text{Dollar Duration} \times \Delta y$
若利率下跌 3%,估计的价格变动:
-100 * 7.36 * -0.03
22.08
重定价后的实际变动:
-npf.pv(rate=0.02, nper=10, pmt=4, fv=100) - 92.28
25.69
用 Python 进行债券定价与分析