qfinbox.tvm.bonds.bond_price

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

Calculate bond price given yield to maturity.

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

Returns:

Bond price.

Return type:

float

Examples

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