OpenBI Docs Buy

QUANT.BOND.DURATION OpenBI

A bond's modified duration at its yield: how much its price moves, in percent, for a change in the yield.

Group: Quantitative finance. OpenBI’s own: DAX has no function of this name.

Syntax

QUANT.BOND.DURATION ( <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 modified duration in years: the relative fall in the dirty price for a rise of one unit of yield.

Remarks

  • A duration of 4.4 means the price falls by about 4.4 % when the yield rises by one percentage point, and by about 0.044 % for one basis point.
  • The longer the bond and the lower its coupon, the longer its duration; a bond without coupons has a duration a little under its remaining life.
  • It is the Macaulay duration divided by one plus the yield per period. With the default conventions it equals the spreadsheet-style MDURATION with basis 1.
  • For the price change itself, in money, use QUANT.BOND.DV01; for how the duration bends, QUANT.BOND.CONVEXITY.
  • 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

The five-year bond's risk measures

Its duration, convexity and DV01 at a yield of 4.5 %, and MDURATION for the duration.

EVALUATE
ROW (
    "Duration", QUANT.BOND.DURATION ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045 ),
    "MDURATION", MDURATION ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045, 1, 1 ),
    "Convexity", QUANT.BOND.CONVEXITY ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045 ),
    "DV01", QUANT.BOND.DV01 ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045 )
)
DurationMDURATIONConvexityDV01
4.425959592506074.4259595925060724.7405516554818-0.0432881029409165

The holdings at 4 %, longest first

EVALUATE
SELECTCOLUMNS (
    Holdings,
    "Bond", Holdings[Bond],
    "Duration", ROUND ( QUANT.BOND.DURATION ( DATE ( 2026, 10, 13 ), Holdings[Maturity], Holdings[Coupon], 0.04 ), 3 )
)
ORDER BY [Duration] DESC
BondDuration
Government 20335.714
Municipal 20314.379
Corporate 20303.55
Covered 20292.472
Government 20281.302

QUANT.BOND.DV01, QUANT.BOND.CONVEXITY, QUANT.BOND.PRICE, MDURATION, QUANT.KEYRATE.

Last updated · OpenBI Studio 0.3.74