OpenBI Docs Buy

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>] )
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 %.
priceNumberThe clean price for each 100 of nominal, as the bond is quoted.
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 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 YIELD with basis 1.
  • A blank price is an error, not a blank yield: test it with IF and ISBLANK when 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 ) )
PriceYield
97.80501162778540.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] )
        )
)
BondPriceYield
Government 202897.840.0463540412627573
Government 203392.150.0364169323815163
Municipal 2031(blank)(blank)
Covered 2029(blank)(blank)
Corporate 2030101.30.0439510854724537

QUANT.BOND.PRICE, QUANT.BOND.DURATION, YIELD, QUANT.OPTION.IMPLIEDVOL.

Last updated · OpenBI Studio 0.3.74