Contents:
Calculate convexity of a bond.
face_value (float) – Face value of the bond.
coupon_rate (float) – Annual coupon rate (as decimal).
years_to_maturity (float) – Years until maturity.
yield_to_maturity (float) – Yield to maturity (as decimal).
payments_per_year (int, default 2) – Number of coupon payments per year.
Convexity.
float
Examples
>>> bond_convexity(1000, 0.06, 10, 0.08) 64.93