1. Learn
  2. /
  3. Courses
  4. /
  5. Bond Valuation and Analysis in Python

Exercise

Creating a duration neutral portfolio

Hedging is a very important part of working with bonds and bond portfolios. In this exercise, you are going to find the quantity of a bond needed to hedge a portfolio, as well as the dollar amount of this quantity.

Say you own a portfolio of bonds whose combined DV01 is USD 5,000. You decide to hedge this portfolio by selling a fixed amount of the 30 year bond from the previous exercise, which has a price of USD 76.94 and a DV01 of 12.88 cents.

Instructions

100 XP
  • Assign the DV01 of the portfolio and the bond to portfolio_dv01, bond_dv01, respectively, and the bond price to bond_price.
  • Find the number of bonds needed to hedge the portfolio.
  • Find the dollar value of this amount of bonds.