previousCouponDate¶
Evaluates the coupon date which immediately precedes the settlement date.
Synopsis¶
previousCouponDate (settlement, maturity, frequency, basis)
Required Arguments¶
- date
settlement
(Input) - The date on which payment is made to settle a trade. For a more detailed discussion on dates see the Usage Notes section of this chapter.
- date
maturity
(Input) - The date on which the bond comes due, and principal and accrued interest are paid. For a more detailed discussion on dates see the Usage Notes section of this chapter.
- int
frequency
(Input) - Frequency of the interest payments. It should be one of
ANNUAL
,SEMIANNUAL
orQUARTERLY
. For a more detailed discussion onfrequency
see the Usage Notes section of this chapter. - int
basis
(Input) - The method for computing the number of days between two dates. It should
be one of
DAY_CNT_BASIS_ACTUALACTUAL
,DAY_CNT_BASIS_NASD
,DAY_CNT_BASIS_ACTUAL360
,DAY_CNT_BASIS_ACTUAL365
, orDAY_CNT_BASIS_30E360
. For a more detailed discussion onbasis
see the Usage Notes section of this chapter.
Return Value¶
The coupon date which immediately precedes the settlement date.
Description¶
Function previousCouponDate
computes the coupon date which immediately
precedes the settlement date. For a good discussion on day count basis, see
SIA Standard Securities Calculation Methods 1993, vol 1, pages 17-35.
Example¶
In this example, previousCouponDate
computes the previous coupon date of
a bond with the settlement date of November 11, 1986, and the maturity date
of March 1, 1999, using the Actual/365 day count method.
from __future__ import print_function
from numpy import *
from datetime import date
from pyimsl.math.previousCouponDate import previousCouponDate, DAY_CNT_BASIS_ACTUAL365, SEMIANNUAL
frequency = SEMIANNUAL
basis = DAY_CNT_BASIS_ACTUAL365
settlement = date(1996, 11, 11)
maturity = date(2009, 3, 1)
pcdate = previousCouponDate(settlement, maturity,
frequency, basis)
print("The previous coupon date before the settlement date is ", pcdate)
Output¶
The previous coupon date before the settlement date is 1996-09-01