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 ofargs1toargs5.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:QuarterlyCalendar: Holiday objectAdjusterRule:FollowingKeepEndOfMonth:TrueLongStub:FalseEndStub:FalseLastOpenday:FalseAdjStartDate:TrueAdjEndDate:TrueStubDate: EmptybothStub:False
Parameter Allocation
args1:StartDate,EndDate,Frequencyargs2:Calendar,AdjusterRule,KeepEndOfMonthargs3:LongStub,EndStub,LastOpendayargs4:AdjStartDate,AdjEndDate,StubDateargs5:bothStub
Excel Call
=McpSchedule(args1, args2, args3, args4, args5, "VP|VP|VP|VP|VP")Summary
McpScheduleis used to construct a schedule object, supporting parameter lists passed throughargs1toargs5.fmtis used to specify the format of eachargs(e.g.,VPfor vertically arranged parameters).- Parameters can be allocated to
args1toargs5as needed, and unusedargscan be left empty.
If you have further questions or need additional clarification, feel free to ask!
