MakeSchedule





http://www.QuantTools.com
CapeTools Calendars function list

Welcome | Documentation format | QuantTools Groups | QuantTools Categories | Licence

Key TAGs | Excel Index | API Index



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"



Note: Within Excel, the function is named - CT.SCH.MakeSchedule




High level graphic of MakeSchedule() function with parameters. Blue square node is the actual function with the parameters ordered.



Parameter Description


  1. Key parameter

    Key value to use as a handle for the created object
  2. 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).
  3. CalendarKey parameter

    Calendar key for the adjustments of dates.
  4. StartDate parameter

    Initial Start Date.
  5. EndDate parameter

    Final End Date.
  6. Freq parameter

    Frequency of the schedule.
  7. BusDayConv parameter

    Business day convention needed for day adjustments when an adjustment moves the date into the preceding, following month.
  8. 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.
  9. 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.
  10. 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.


Extended information

Function Syntax

VB Syntax


String CTCalendars.MakeSchedule( _
String Key, _
Long Reload, _
String CalendarKey, _
Long StartDate, _
Long EndDate, _
FreqEnum Freq, _
BDCEnum BusDayConv, _
Long stubDate, _
Boolean startFromEnd, _
Boolean longFinal)


Excel Spreadsheet Syntax


=CT.SCH.MakeSchedule(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel String Cell CalendarKey,
Excel Numeric Cell StartDate,
Excel Numeric Cell EndDate,
Excel String Cell Freq,
Excel String Cell BusDayConv,
Excel Numeric Cell stubDate,
Excel Boolean Value Cell startFromEnd,
Excel Boolean Value Cell longFinal)


C++ Syntax


static std::string MakeSchedule(
std::string Key,
long Reload,
std::string CalendarKey,
long StartDate,
long EndDate,
FreqEnum Freq,
BDCEnum BusDayConv,
long stubDate,
bool startFromEnd,
bool longFinal);


DotNET Syntax


System.String CTCalendarsSA.MakeSchedule(
System.String Key,
System.Int32 Reload,
System.String CalendarKey,
System.Int32 StartDate,
System.Int32 EndDate,
CTIEnums.FreqEnum Freq,
CTIEnums.BDCEnum BusDayConv,
System.Int32 stubDate,
System.Boolean startFromEnd,
System.Boolean longFinal);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
CalendarKeyStringTRUE
StartDateLongFALSE
EndDateLongFALSE
FreqFreqEnumFALSE
BusDayConvBDCEnumFALSE
stubDateLongFALSE
startFromEndBooleanFALSE
longFinalBooleanFALSE


Example Inputs

The first column represents the name of the parameters. The second column specifies whether the parameters are optional or not. Finally the last column provides some sample input data.
Function call input string-keys are always in the format : "NAME.EXTTAG.TICKER" The "EXTTAG.TICKER" part is determined from the output of other, capetools, object creation functions.


ArgNameIsOptional (Excel only)Example
KeyFALSEMySchedule
ReloadFALSE1
CalendarKeyFALSECalendarKeyNAME.EXTTAG.TICKER (from a function call)
StartDateFALSE21/Jul/2006 (serial date type)
EndDateFALSE21/Jul/2011 (serial date type)
FreqFALSEQ
BusDayConvFALSEModifiedFollowing
stubDateTRUE0
startFromEndFALSEtrue
longFinalFALSEfalse


Example function usage


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.


If you are accessing this functrion via the MiniXL libraries, this function is present within the CT.QL.Curves20 MiniXL Excel Addin.

Within our Excel Example Addin Generator, we have used the following QuantTools sub-functions in order to prepare the arguments needed to call the MakeSchedule() function. If you are executing this function via the MiniXL libraries, the module addin name, (in brackets, to the right of the sub-functions listed below), indicates the MiniXL library in which the sub-function is held. You will need to load this library into your Excel session (along with any other libraries that the sub-function call within the addin requires (ie - CT.QT.Utils20 addin in almost all cases) in order for the example to compute successfully.

These are the financial QuantTools sub-function calls that are used within the examples :





The objects generated by these sub-functions are inter-connected in the following way :




The following four examples demostrate calling this function within a Microsoft .NET environment

The following four examples demostrate calling this function within a non .NET environment

The following is a sample output from executing the MakeSchedule() function call


MySchedule_47.MSCH.0

Copyright (c) 2003-2007 CapeTools - All Rights Reserved.