Functions Related to Schedule Objects
About 1 min
Functions Related to Schedule Objects
Visit the Mathema Option Pricing System for foreign exchange options and structured product valuation!
Constructor Functions
Excel: =McpSchedule(args1, args2, args3, args4, args5, fmt="VP")
Python: McpSchedule(*args)
- Function: Constructs a schedule object.
- Parameters:
args1~args5 or *args
: Parameter groups, supporting the following input methods:- Parameter List:
StartDate
: Date, the start date.EndDate
: Date, the end date.Frequency
: Enum, the frequency of the schedule (default isMonthly
).Calendar
: Object, the holiday calendar.AdjusterRule
: Enum, the adjustment rule (default isModifiedFollowing
).KeepEndOfMonth
: Boolean, whether to keep the end of the month (default isFalse
).LongStub
: Boolean, whether to use a long stub (default isFalse
).EndStub
: Boolean, whether to use an end stub (default isFalse
).LastOpenday
: Boolean, whether to use the last open day (default isFalse
).AdjStartDate
: Boolean, whether to adjust the start date (default isTrue
).AdjEndDate
: Boolean, whether to adjust the end date (default isTrue
).StubDate
: Date, the stub date.bothStub
: Boolean, whether to use dual stubs (default isFalse
).
- Parameter List:
fmt
: Parameter format (default isVP
), used to specify the format ofargs1
toargs5
.VP
: Vertically arranged parameters.HD
: Horizontally arranged data.
- Returns: A schedule object.
Usage Functions
Excel: =ScheduleDates(obj)
Python: dates()
- Function: Extracts dates from a Schedule object and returns them as an array.
- Parameters:
obj
: Schedule object,The Python API does not require this parameter.
- Returns: An array containing the dates extracted from the Schedule object.
Usage Examples
Example 1: Constructing a Schedule Object
Suppose you need to construct a schedule object with the following parameters:
StartDate
: 2023-01-01EndDate
: 2023-12-31Frequency
:Quarterly
Calendar
: Holiday objectAdjusterRule
:Following
KeepEndOfMonth
:True
LongStub
:False
EndStub
:False
LastOpenday
:False
AdjStartDate
:True
AdjEndDate
:True
StubDate
: EmptybothStub
:False
Parameter Allocation
args1
:StartDate
,EndDate
,Frequency
args2
:Calendar
,AdjusterRule
,KeepEndOfMonth
args3
:LongStub
,EndStub
,LastOpenday
args4
:AdjStartDate
,AdjEndDate
,StubDate
args5
:bothStub
Excel Call
=McpSchedule(args1, args2, args3, args4, args5, "VP|VP|VP|VP|VP")
Summary
McpSchedule
is used to construct a schedule object, supporting parameter lists passed throughargs1
toargs5
.fmt
is used to specify the format of eachargs
(e.g.,VP
for vertically arranged parameters).- Parameters can be allocated to
args1
toargs5
as needed, and unusedargs
can be left empty.
If you have further questions or need additional clarification, feel free to ask!