Waardering en analyse van obligaties in Python
Joshua Mayhew
Options Trader
De ‘gemiddelde’ tijd om je geld terug te krijgen
Langer wachten = meer blootstelling aan rente
Duration is de afgeleide (veranderingssnelheid) van prijs t.o.v. rendement
De helling van de raaklijn is de duration


We kunnen de factoren die de duration beïnvloeden onderzoeken door:
import numpy as np
import numpy_financial as npf
import pandas as pd
import matplotlib.pyplot as plt
bond_maturity = np.arange(0, 30, 0.1)bond = pd.DataFrame(bond_maturity, columns=['bond_maturity'])bond['price'] = -npf.pv(rate=0.05, nper=bond['bond_maturity'], pmt=5, fv=100)bond['price_up'] = -npf.pv(rate=0.05 + 0.01, nper=bond['bond_maturity'], pmt=5, fv=100)bond['price_down'] = -npf.pv(rate=0.05 - 0.01, nper=bond['bond_maturity'], pmt=5, fv=100)bond['duration'] = (bond['price_down'] - bond['price_up']) / (2 * bond['price'] * 0.01)
plt.plot(bond['bond_maturity'], bond['duration'])plt.xlabel('Looptijd (jaren)')plt.ylabel('Duration (%)')plt.title("Effect van variërende looptijd op de duration")plt.show()

De duration van een obligatie neemt toe bij:
Waardering en analyse van obligaties in Python