Example: Previous Coupon Date Before the Settlement Date
In this example, the settlement date is 11/11/86. The previous coupon date before this date is returned.
using System;
using Imsl.Finance;
public class couppcdEx1
{
public static void Main(String[] args)
{
DateTime settlement = DateTime.Parse("11/11/86");
DateTime maturity = DateTime.Parse("3/1/99");
Bond.Frequency freq = Bond.Frequency.SemiAnnual;
DayCountBasis dcb = DayCountBasis.BasisActual365;
DateTime couppcd = Bond.Couppcd(settlement, maturity, freq,
dcb);
Console.Out.WriteLine("The previous coupon date before the " +
"settlement \ndate is " +
couppcd.ToLongDateString());
}
}
Output
The previous coupon date before the settlement
date is Monday, September 01, 1986
Link to C# source.