OpenBI Docs Buy

QUANT.BOND.CONVEXITY OpenBI

A bond's convexity at its yield: how its duration changes as the yield moves.

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

Syntax

QUANT.BOND.CONVEXITY ( <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 convexity in years squared: the second derivative of the dirty price by the yield, divided by the price.

Remarks

  • Duration alone treats the price as a straight line in the yield; convexity adds the curve. For a change dy in the yield the price changes by about −duration × dy + ½ × convexity × dy², as a share of the dirty price.
  • An ordinary bond's convexity is positive: it gains a little more when yields fall than it loses when they rise by as much.
  • 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 one-point rise, with and without convexity

The five-year 4 % bond from 4.5 % to 5.5 %: the duration's estimate, the estimate with convexity, and the price change worked out exactly, all as a share of the dirty price (here the clean one: a coupon date).

EVALUATE
VAR D = QUANT.BOND.DURATION ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045 )
VAR C = QUANT.BOND.CONVEXITY ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045 )
VAR P0 = QUANT.BOND.PRICE ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.045 )
VAR P1 = QUANT.BOND.PRICE ( DATE ( 2026, 10, 13 ), DATE ( 2031, 10, 13 ), 0.04, 0.055 )
RETURN
    ROW (
        "Convexity", C,
        "Duration only", -D * 0.01,
        "With convexity", -D * 0.01 + C / 2 * 0.01 ^ 2,
        "Exact", P1 / P0 - 1
    )
ConvexityDuration onlyWith convexityExact
24.7405516554818-0.0442595959250607-0.0430225683422866-0.0430493107780371

QUANT.BOND.DURATION, QUANT.BOND.DV01, QUANT.BOND.PRICE.

Last updated · OpenBI Studio 0.3.74