CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Bond Valuation and Analysis in Python

Afficher le cours

Instructions

  • 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.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# 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", ____)
Modifier et exécuter le code