QUANT.BOND.PRICE OpenBI
A bond's clean price for each 100 of nominal, worked out from its yield with QuantLib.
Group: Quantitative finance. OpenBI’s own: DAX has no function of this name.
Syntax
QUANT.BOND.PRICE ( <settlement>, <maturity>, <coupon>, <yieldRate> [, <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 %. |
yieldRate | Number | The yield to maturity as a decimal, compounded as many times a year as the coupon is paid. |
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 clean price for each 100 of nominal: what the coupons and the redemption are worth at the yield, less the interest accrued since the last coupon.
Remarks
- To value a holding, multiply by its nominal and divide by 100. What a buyer pays is the dirty price: the clean price plus
QUANT.BOND.ACCRUED. - At a yield equal to the coupon, on a coupon date, the price is 100. A higher yield gives a lower price.
- With the default conventions it gives the same price as the spreadsheet-style
PRICEwith basis 1, whose arguments come in another order. - 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.
- The yield is compounded at the coupon frequency, with the day count given: the convention of a bond's own quote.
- 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
A five-year bond at three yields
A 4 % bond with annual coupons, bought on a coupon date. At 4 % it is worth par; PRICE agrees.
EVALUATE
ROW (
"At 3.5 %", QUANT.BOND.PRICE ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.035 ),
"At 4 %", QUANT.BOND.PRICE ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.04 ),
"At 4.5 %", QUANT.BOND.PRICE ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045 ),
"PRICE at 4.5 %", PRICE ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045, 100, 1, 1 )
)
| At 3.5 % | At 4 % | At 4.5 % | PRICE at 4.5 % |
|---|---|---|---|
| 102.257526187735 | 100 | 97.8050116277854 | 97.8050116277854 |
Between two coupons, paid twice a year
A 3.5 % bond to 15 June 2031 on the 30/360 count, two months into its coupon period: the clean price, the interest accrued, and their sum.
EVALUATE
VAR Clean =
QUANT.BOND.PRICE ( DATE ( 2026, 10, 13 ), DATE ( 2031, 6, 15 ), 0.035, 0.04, 2, "30/360" )
VAR Accrued =
QUANT.BOND.ACCRUED ( DATE ( 2026, 10, 13 ), DATE ( 2031, 6, 15 ), 0.035, 2, "30/360" )
RETURN
ROW ( "Clean", Clean, "Accrued", Accrued, "Dirty", Clean + Accrued )
| Clean | Accrued | Dirty |
|---|---|---|
| 97.884424195417 | 1.14722222222223 | 99.0316464176393 |
The holdings at a yield of 4 %
Each bond of the Holdings table priced at the same yield, and what its nominal is worth then.
EVALUATE
SELECTCOLUMNS (
Holdings,
"Bond", Holdings[Bond],
"Clean at 4 %", ROUND ( QUANT.BOND.PRICE ( DATE ( 2026, 10, 13 ), Holdings[Maturity], Holdings[Coupon], 0.04 ), 4 ),
"Value, clean", ROUND ( QUANT.BOND.PRICE ( DATE ( 2026, 10, 13 ), Holdings[Maturity], Holdings[Coupon], 0.04 ) * Holdings[Nominal] / 100, 0 )
)
| Bond | Clean at 4 % | Value, clean |
|---|---|---|
| Government 2028 | 98.6656 | 246664033 |
| Government 2033 | 90.2517 | 270755113 |
| Municipal 2031 | 97.8136 | 146720411 |
| Covered 2029 | 99.9831 | 119979736 |
| Corporate 2030 | 102.7866 | 82229262 |
Related functions
QUANT.BOND.ACCRUED, QUANT.BOND.YIELD, QUANT.BOND.DV01, QUANT.BOND.DURATION, PRICE.