DURATION Function
Evaluates the annual duration of a security where the security has periodic interest payments.
Usage
result = DURATION(settlement, maturity, coupon_rate, yield, frequency, basis)
Input Parameters
settlementThe date on which payment is made to settle a trade. For a more detailed discussion on dates see Chapter 8, Working with Date/Time Data in the .
maturityThe date on which the bond comes due, and principal and accrued interest are paid. For a more detailed discussion on dates see Chapter 8, Working with Date/Time Data in the .
coupon_rateAnnual interest rate set forth on the face of the security; the coupon rate.
yieldAnnual yield of the security.
frequencyFrequency of the interest payments. It should be 1, 2, or 4.
*1One payment per year (Annual payment)
*2Two payments per year (Semi-annual payment)
*4Four payments per year (Quarterly payment)
basisThe method for computing the number of days between two dates. It should be 0, 1, 2, 3, or 4.
*0Actual/Actual
*1US (NASD) 30/360
*2Actual/360
*3Actual/365
*4European 30/360
Returned Value
resultThe annual duration of a security with periodic interest payments. If no result can be computed, NaN is returned.
Input Keywords
DoubleIf present and nonzero, double precision is used.
Discussion
Function DURATION computes the Maccaluey's duration of a security with periodic interest payments. The Maccaluey's duration is the weighted-average time to the payments, where the weights are the present value of the payments.
It is computed using the following:
In the equation above, DSC represents the number of days starting with the settlement date and ending with the next coupon date. E represents the number of days within the coupon period. N represents the number of coupons payable from the settlement date to the maturity date. freq represents the frequency of the coupon payments annually.
Example
In this example, DURATION computes the annual duration of a security with the settlement date of July 1, 1995, and maturity date of July 1, 2005, using the Actual/365 day count method.
settlement = VAR_TO_DT(1995, 7, 1)
maturity = VAR_TO_DT(2005, 7, 1)
coupon = .075
yield = .09
frequency = 2
basis = 3
PRINT, DURATION(settlement, maturity, coupon, $
   yield, frequency, basis)
; PV-WAVE prints: 7.04195