fixed-income_bond
Compute bond price, yield, duration, convexity, and accrued interest. Input face value, coupon rate, maturity, and yield or price to get key fixed-income risk metrics.
Instructions
Bond price, Macaulay/modified duration, convexity, DV01.
Use when pricing a bond or computing yield, duration, and convexity. Provide face value, coupon rate, maturity, and yield or price. Returns: bond price (or yield), Macaulay duration, modified duration, convexity, and accrued interest.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ytm | Yes | Yield to maturity (annualized) | |
| face | No | Face/par value of the bond | |
| years | Yes | Years to maturity | |
| frequency | No | Coupon payments per year | |
| coupon_rate | Yes | Annual coupon rate (e.g. 0.05 = 5%) |