MakeSchedule2





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 final end dates.

You can view the generated dates via the DisplaySchedule() function.

This function requires the input of an Index object key, which must have been produced via a call to one of the Index creation functions present within the CapeTools Indexes category of functions.

These functions would have returned a string 'KEY' which is to be passed to the 'IndexKey' parameter of this function.



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 : "MSCH2"



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




High level graphic of MakeSchedule2() 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. StartDate parameter

    Initial Start Date.
  4. EndDate parameter

    Final End Date.
  5. IndexKey parameter

    Index Key in order to acquire all the Schedule generation parameters.
  6. 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.
  7. 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.
  8. 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.MakeSchedule2( _
String Key, _
Long Reload, _
Long StartDate, _
Long EndDate, _
String IndexKey, _
Long stubDate, _
Boolean startFromEnd, _
Boolean longFinal)


Excel Spreadsheet Syntax


=CT.SCH.MakeSchedule2(
Excel String Cell Key,
Excel Numeric Cell Reload,
Excel Numeric Cell StartDate,
Excel Numeric Cell EndDate,
Excel String Cell IndexKey,
Excel Numeric Cell stubDate,
Excel Boolean Value Cell startFromEnd,
Excel Boolean Value Cell longFinal)


C++ Syntax


static std::string MakeSchedule2(
std::string Key,
long Reload,
long StartDate,
long EndDate,
std::string IndexKey,
long stubDate,
bool startFromEnd,
bool longFinal);


DotNET Syntax


System.String CTCalendarsSA.MakeSchedule2(
System.String Key,
System.Int32 Reload,
System.Int32 StartDate,
System.Int32 EndDate,
System.String IndexKey,
System.Int32 stubDate,
System.Boolean startFromEnd,
System.Boolean longFinal);

Parameter data types

ArgNameArgTypeIsKey
KeyStringFALSE
ReloadLongFALSE
StartDateLongFALSE
EndDateLongFALSE
IndexKeyStringTRUE
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
KeyFALSEMy2ndSchedule
ReloadFALSE1
StartDateFALSE21/Jul/2006 (serial date type)
EndDateFALSE21/Jul/2011 (serial date type)
IndexKeyFALSEIndexKeyNAME.EXTTAG.TICKER (from a function call)
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 MakeSchedule2() 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 MakeSchedule2() function call


My2ndSchedule_48.MSCH2.0

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