Generates a schedule of start and end dates, given the initial start date and unadjusted final end dates.
You can view the generated dates via the
DisplaySchedule() function.
This function requires the input of a Calendar object key, which must have been produced via a call to one of the Calendar creation functions present within the
CapeTools Calendars category of functions.
These functions would have returned a string 'KEY' which is to be passed to the 'CalendarKey' parameter of this function.
Please refer to the large number of enumeration functions present within the
CapeTools Enums category of functions.
The
CapeTools Enums category of functions return correct string codes that can be passed to parameters taking fixed string values defined by the library (ie - DayCount codes, frequency codes, currency codes, compounding codes, business day convention codes etc...).
You can thus execute these enumeration functions which return the proper code, instead of trying to remember the string code needed or making spelling mistakes which can be difficult to debug.
This function creates an object and returns a string-key value to represent this created object.
The TAG value of the string-key returned (second part of the key) is : "MSCH"
- Key parameter
Key value to use as a handle for the created object
- Reload parameter
When creating this object for the first time, set this parameter to a positive value. Within Excel, when re-computing a worksheet where you do not wish to recreate the object, set this parameter to zero (0).
- CalendarKey parameter
Calendar key for the adjustments of dates.
- StartDate parameter
Initial Start Date.
- EndDate parameter
Final End Date.
- Freq parameter
Frequency of the schedule.
- BusDayConv parameter
Business day convention needed for day adjustments when an adjustment moves the date into the preceding, following month.
- stubDate parameter
Setting this value a 0 (or an empty date) imply that the date generation routine will define a first odd and/or last odd coupon periods if needed (based on the dates passed to the 'StartDate' and 'EndDate' parameters and the value of the 'startFromEnd' parameter). If you want to define a last odd coupon period set this parameter to the date of the last coupon prior to 'EndDate' parameter and set the 'startFromEnd' parameter to true. Dates will then roll backwards from this stub date. During this calculation you may also have an odd first period if the 'StartDate' does not fall on a full coupon period from this stub date. If you want to define a first odd coupon, set this parameter to the date of the first coupon after the 'StartDate' and set the 'startFromEnd' parameter to false. Dates will
then roll forwards from this stub date. During this calculation you may also have an odd last period if the 'EndDate' does not fall on a full coupon period from this stub date. If you have a last odd coupon period but wish to merge this with the pervious, full, coupon period, set the 'longFinal' parameter to true.
- startFromEnd parameter
Setting this parameter to 'false' imply that date generation will start from the StartDate and then add whole coupon periods until the EndDate is reached. Setting this parameter to 'true' imply that date generation will start from the EndDate and roll backwards in time (by whole coupon periods) until the StartDate is reached.
- longFinal parameter
If during coupon date generation, there is a last odd coupon period but you wish to merge this with the pervious, full, coupon period, set the 'longFinal' parameter to true.
The C# example below contains all the sub-function calls leading up to this function call. As a result, the example can contain a lot of code.
The VB.NET, J#, C++.NET, Java, Excel VBA, Visual Basic 6 (via COM) and C++ examples below contain function code stubs for the calls leading up to this function call. However, the function call for this function is displayed.
You can easily reproduce the stub functions code from the
C# example.
Copyright (c) 2003-2007 CapeTools - All Rights Reserved.