QUANT.BOND.YIELD OpenBI
The yield to maturity at which a bond is worth its clean price, solved with QuantLib.
Group: Quantitative finance. OpenBI’s own: DAX has no function of this name.
Syntax
QUANT.BOND.YIELD ( <settlement>, <maturity>, <coupon>, <price> [, <frequency>] [, <dayCount>] [, <redemption>] )
| Parameter | Type | Description |
|---|---|---|
settlement | Date | The day the bond changes hands: everything is worked out as of this day. |
maturity | Date | The day the bond pays its last coupon and its redemption. |
coupon | Number | The coupon rate a year, as a decimal: 0.04 for 4 %. |
price | Number | The clean price for each 100 of nominal, as the bond is quoted. |
frequency | Whole number optional | Coupons a year: 1 (when left out), 2, 4 or 12. |
dayCount | Text optional | How days are counted between coupons: "Actual/Actual" (when left out: each coupon period's own days), "Actual/Actual ISDA", "Actual/365", "Actual/360" or "30/360". |
redemption | Number optional | What the bond pays back at maturity for each 100 of nominal; 100 when left out. |
Returns
Number. The yield as a decimal (0.0464 for 4.64 %), compounded at the coupon frequency.
Remarks
- It undoes
QUANT.BOND.PRICE: the price at the yield it returns is the price given, with the same conventions. - A price below 100 gives a yield above the coupon, a price above 100 one below it.
- With the default conventions it gives the same yield as the spreadsheet-style
YIELDwith basis 1. - A blank price is an error, not a blank yield: test it with
IFandISBLANKwhen some prices are missing, as the second example does. - The coupon dates are counted back from the maturity one period at a time, on the same day of the month, and are not moved off weekends or holidays.
- A blank or a text where a number belongs, a maturity on or before the settlement, or a frequency other than 1, 2, 4 or 12 is an error.
Compared with DAX
An OpenBI function: DAX has none like it, so a measure or query that uses it works in OpenBI only, not in Power BI or Analysis Services.
Examples
Back from the price
The price of the five-year 4 % bond at 4.5 %, and the yield that price gives back.
EVALUATE
VAR Price = QUANT.BOND.PRICE ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045 )
RETURN
ROW ( "Price", Price, "Yield", ROUND ( QUANT.BOND.YIELD ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, Price ), 10 ) )
| Price | Yield |
|---|---|
| 97.8050116277854 | 0.045 |
The quoted bonds' yields
Three of the five holdings have a quoted price; the other two get no yield.
EVALUATE
SELECTCOLUMNS (
Holdings,
"Bond", Holdings[Bond],
"Price", Holdings[Price],
"Yield",
IF (
NOT ISBLANK ( Holdings[Price] ),
QUANT.BOND.YIELD ( DATE ( 2026, 10, 13 ), Holdings[Maturity], Holdings[Coupon], Holdings[Price] )
)
)
| Bond | Price | Yield |
|---|---|---|
| Government 2028 | 97.84 | 0.0463540412627573 |
| Government 2033 | 92.15 | 0.0364169323815163 |
| Municipal 2031 | (blank) | (blank) |
| Covered 2029 | (blank) | (blank) |
| Corporate 2030 | 101.3 | 0.0439510854724537 |
Related functions
QUANT.BOND.PRICE, QUANT.BOND.DURATION, YIELD, QUANT.OPTION.IMPLIEDVOL.