OpenBI Docs Buy

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>] )
ParameterTypeDescription
settlementDateThe day the bond changes hands: everything is worked out as of this day.
maturityDateThe day the bond pays its last coupon and its redemption.
couponNumberThe coupon rate a year, as a decimal: 0.04 for 4 %.
yieldRateNumberThe yield to maturity as a decimal, compounded as many times a year as the coupon is paid.
frequencyWhole number
optional
Coupons a year: 1 (when left out), 2, 4 or 12.
dayCountText
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".
redemptionNumber
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 PRICE with 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.25752618773510097.805011627785497.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 )
CleanAccruedDirty
97.8844241954171.1472222222222399.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 )
)
BondClean at 4 %Value, clean
Government 202898.6656246664033
Government 203390.2517270755113
Municipal 203197.8136146720411
Covered 202999.9831119979736
Corporate 2030102.786682229262

QUANT.BOND.ACCRUED, QUANT.BOND.YIELD, QUANT.BOND.DV01, QUANT.BOND.DURATION, PRICE.

Last updated · OpenBI Studio 0.3.74