開始使用免費開始

建立存續期間中性的投資組合

在債券與債券投資組合的實務中,避險非常重要。這個練習中,你將找出為了避險投資組合所需的債券數量,以及對應的美元金額。

假設你持有一個債券投資組合,其合計 DV01 為 5,000 美元。你決定透過賣出上一題中的 30 年期公債的一定數量來進行避險;該債券價格為 76.94 美元,DV01 為 12.88 美分。

本練習屬於課程

使用 Python 進行債券評價與分析

檢視課程

練習說明

  • 分別將投資組合與債券的 DV01 指派給 portfolio_dv01bond_dv01,並將債券價格指派給 bond_price
  • 求出為了避險投資組合所需的債券張數。
  • 求出這個數量的債券所對應的美元金額。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Assign DV01 of portfolio and bond to variables
portfolio_dv01 = ____
bond_dv01 = ____
bond_price = ____

# Calculate quantity of bond to hedge portfolio
hedge_quantity = ____
print("Number of bonds to sell: ", ____)

# Calculate dollar amount of bond to hedge portfolio
hedge_amount = ____
print("Dollar amount to sell: USD", ____)
編輯並執行程式碼