ComeçarComece de graça

Comparing the convexity of two bonds directly

You can also investigate the influence of factors on bond convexity by pricing-up two bonds that vary only in this factor and then calculating the convexity of each bond directly.

In this exercise, you will find the convexity of two bonds; both will be 5 year bonds with a yield of 3% and face value of USD 100, but the first bond will pay a 1% coupon and the second bond will pay a 10% coupon.

numpy_financial has already been imported for you as npf.

Este exercício faz parte do curso

Bond Valuation and Analysis in Python

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Find the price of a 5 year bond with 3% yield and 1% coupon
price_1 = ____

# Shift yields up and down 1% and reprice
price_up_1 = ____
price_down_1 = ____

# Find convexity of the bond and print the result
convexity_1 = ____
print("Low Coupon Bond Convexity: ", ____)
Editar e executar o código