Investment Studio > Expressions > Functions > Financial > DURATION

float duration(date settlement_date, date maturity_date, float annual_coupon_rate, float annual_yield, integer coupons_per_year, integer day_count_basis = 0)

Returns a bond's Macauley duration for an assumed face value of 100.

settlement_date is the date (in the range [issue date, maturity_date[) when the bond is traded.

maturity_date is the date when the bond expires.

Automatic type conversion allows the use of date strings as arguments instead of explicit date values.

annual_coupon_rate is one year's worth of coupon payments divided by the bond's face value.

annual_yield is the bond's annual yield.

coupons_per_year is the number of coupon payments made in a whole year. It must be one of the following integer values: 1 (annual), 2 (semiannual) or 4 (quarterly).

day_count_basis specifies the calendar convention used to count days and compute the corresponding fraction of a year:

day_count_basis Interpretation
0 US (NASD) 30/360: If the start date is the 31st of a month, it's set to the 30th of the same month. If the end date is the 31st of a month, it's set to the 30th of the same month unless the start date is less than the 30th of a month, in which case the end date is set to the 1st of the next month.

The denominator used to compute the fraction of a year is 360.

1 Actual calendar days are counted and used to compute the fraction of a year.
2 Actual calendar days are counted. The denominator used to compute the fraction of a year is 360.
3 Actual calendar days are counted. The denominator used to compute the fraction of a year is 365.
4 European 30/360: Start and end dates that occur on the 31st of a month are set to the 30th of the same month. The denominator used to compute the fraction of a year is 360.

If day_count_basis is omitted, it defaults to 0 (NASD-style 360/30).

The Macauley duration is the weighted average of the time left until the receipt of each future bond payment, with weight = payment / bond's total value. It's a measure of the bond price's response to a change in yield.

Example

Consider a bond with the following properties:

Assuming standard US date format settings, the Macauley duration is

=duration("6/15/2002", "10/30/2005", 5%, 7%, 2, 1)

» 3.12 years.

See also mduration.