WebCab Bonds for .NET v2.01

BusinessCalendar.previousPaymentDate Method 

Returns the index of the element of an ordered array of dates which is after and closest to a given date. The array of dates is ordered with respect to the following rule: the lower the index of an element the earlier the date.

int previousPaymentDate(
   DateTime[] payments,
   DateTime date
);

Parameters

payments
the array of dates
date
the date from which the arrays closest prior member is found

Return Value

the index of the previous date from the array prior to the given date @throws IllegalArgumentException if the given date is before the first payment date

Remarks

To know the prior element is particularly useful if we are evaluating a metric of an interest paying instrument. For example, if we consider a bond sale on a given date and the array of dates represents the dates on which coupons are paid. Then by knowing the date which is the prior coupon payment before the sale date we are able to evaluated the accrued interest earned by the bond.

See Also

BusinessCalendar Interface | WebCab.BusinessCalendar Namespace | Calendar)