qfinbox.tvm.bonds.bond_yield_to_maturity

qfinbox.tvm.bonds.bond_yield_to_maturity(price: float, face_value: float, coupon_rate: float, years_to_maturity: float, payments_per_year: int = 2) float[source]

Calculate bond yield to maturity given price.

Parameters:
  • price (float) – Current bond price.

  • face_value (float) – Face value of the bond.

  • coupon_rate (float) – Annual coupon rate (as decimal).

  • years_to_maturity (float) – Years until maturity.

  • payments_per_year (int, default 2) – Number of coupon payments per year.

Returns:

Yield to maturity (as decimal).

Return type:

float

Examples

>>> bond_yield_to_maturity(864.10, 1000, 0.06, 10)
0.08