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>] )
| 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 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
)
| Convexity | Duration only | With convexity | Exact |
|---|---|---|---|
| 24.7405516554818 | -0.0442595959250607 | -0.0430225683422866 | -0.0430493107780371 |