Defining Date Rules

Date rules are used throughout the system to generate a schedule of dates based on complex frequencies.

Related Topics Link IconRelated Topics

 

From the Calypso Navigator, navigate to Configuration > Definitions > Date Schedule Definitions > Date Rules (menu action refdata.DateRuleWindow) for defining date rules.

Date Rule window

» Date rules are identified by a name throughout the system. Once a date rule is defined, you can enter from and to dates, and click Generate to check that the dates correspond to the dates you want to obtain.

The general process for generating dates is the following:

The system generates default dates based on the selected type and selected months (for example every first day of the month).
Then you can add business days or calendar days (depending on the Bus/Cal radio buttons) to the default generated dates (see Add Days below).
Finally, you can have an additional check that the new date is a business date (see Check Holiday below). If is falls on a holiday, the date will be rolled according to the date roll convention.
» You can implement custom date generators. Refer to the Calypso Developer’s Guide for details. Once a custom generator is implemented, to define the date rule, you must select the CUSTOM type, then save it as the name of your custom generator. So for example, if you have created a custom generator named DateGeneratorMyDateRule, you must save the date rule as MyDateRule.

 

1. Creating a Date Rule

Click New to define a date rule, and enter the fields described below.

Then click Save As New to save your changes. You will be prompted to enter a rule name. The new date rule will be added to the list.

 

Date Rule Fields Details

Fields

Description

Name

The name identifies the date rule throughout the system.

Type

Select the type of date rule that you want to create.

ADD_PERIOD – This rule is used to add a number of days / weeks / months / years to a reference date, and repeating the frequency on the generated date to generate the following date.

For example, the rule is defined as "Add 2 Months". If you generate the dates between 03/12/2012 and 07/12/2012, you will obtain "03/12/2012 + 2 months = 05/12/2012" and "05/12/2012 + 2 months = 07/12/2012".

For "Days", you can specify whether the days are business days or calendar days.
For "Months", "Weeks", and "Years", the generated date follows the "Check Holidays" logic described below.
When the date roll is set to END_MONTH, the date is always rolled to the end of the month even if the generated date is a business day.
ADD_TERM – This rule is used to generate a date from a term. The term is added to today's date, and a single date is generated. The tenor is entered as a number of days, weeks, months, or years.
For "Days", you can specify whether the days are business days or calendar days.
For "Months", "Weeks", and "Years", the generated date follows the "Check Holidays" logic described below.
BEG_MONTH – This rule is used to generate the first day of the month. You can select the months for which you want to generate the date. It can be modified with the Add Days field.
BEG_YEAR – This rule is used to generate the first day of the year. It can be modified with the Add Days field.
CUSTOM – This rule is used to define a custom date generator (refer to the Calypso Developer’s Guide for details on implementing a custom date generator). Once a custom generator is implemented, to define the date rule, you must select the CUSTOM type, then save it as the name of your custom generator. So for example, if you have created a custom generator named DateGeneratorMyDateRule, you must save the date rule with the name "MyDateRule".

Calypso provides some Out-of-the-Box Custom Date Generators as described below.

DAILY – This rule is use to generate every day.
DAY_FIXED – This rule is used to generate a fixed day in a month. You can set the day in the Day field, and check individual months. If you do not select any month, a date will be generated for every month.
DAY_MONTH_FIXED – This rule is used to generate a fixed day in a given month. You can set the day in the Day field, and select the month from the Month field.
DIFFERENCE – This rule is used to generate the difference between two date rules. You can select the rules to be compared from the Rules field.
END_MONTH – This rule is used to generate the last day of the month. You can select the months for which you want to generate the date. It can be modified with the Add Days field.
END_YEAR – This rule is used to generate the last day of the year. Can be modified with the Add Days and Add Relative Months fields.
IMM – This rule is used to generate dates for future and listed option contracts.
INTERSECTION – This rule is used to generate the first possible date in the future or past that matches ALL selected rules. You can select a list of rules.
RELATIVE – This rule is used to adjust an existing rule. You can select the rule to be adjusted from the Relative field.
RULE_SEQUENCE – This rule is used to apply multiple date rules in sequence to form one aggregated date rule. You first select a date rule, then you indicate the duration of this date rule in number of dates or as a term (like number of months). The last date rule will be applied indefinitely.

In this example, the dates from "@Begin of Month" are generated for 1 month, then two dates are generated from "@Daily Date Rule", then the dates from "@25th Calendar Day of Month" are generated for 1 year (or until the end of the period).

Generated Dates: For 1 month, the beginning of the month: Jan 1, 2009 and Feb 1, 2009 - Then 2 days: Feb 2, 2009 and Feb 3, 2009 - Then the 25th of the month for the rest of the period: Feb 25, 2009, Mar 25, 2009, Apr 25th, 2009, etc.

UNION – This rule is used to generate the first possible date in the future or past that matches one of the selected rules. You can select a list of rules.
WEEKDAY_CBOT – This rule is used to generate dates for future and listed option contracts.
WEEKDAY_FIXED – This rule is used to generate a fixed day in a week. You can select the day from the WeekDay field.
WEEKLY – This rule is used to generate a day in a week according to a rank (for example, every third Tuesday). You can select the day from the WeekDay field, and the rank from the Rank field.

Day

Enter the day in the month for DAY_FIXED or DAY_MONTH_FIXED.

Add Days

Enter a number of days to be added to the default calculated dates.

For example, if you enter 2 for BEG_MONTH, the rule will add 2 days to the first day of the month.

Select the radio button Bus or Cal to specify whether to add business days or calendar days.

You can check the Bus Days checkbox to indicate that, before adding the specified number of days, if the date falls on a holiday, the system uses the specified Date Roll to roll to the following business day. Then the specified number of days are added.

Month

Select the month for DAY_MONTH_FIXED.

Individual Months

You can check individual months to which the rule applies. You can also click Select All to apply the rules to all months.

Click UnSelect All to clear all months.

Add Relative Months

Relative Type

Add Relative Months - The Add Relative Months field uses the value in the field to add that number of months to the individual months already selected. These months are added relative to selected months and are not static. Relative months depend on the date on which the date schedule is in use (the current day's date, aka, the anchor date) and therefore change over time accordingly.

Relative Type - The Relative Type settings create further conditions for the way the anchor date and relative months affect the schedule of dates. Refer to the example below to see how they differ in use.

The From Date in the following example refers to the date generated by the Next & Previous button used in testing the date rule. See Testing a Date Rule. This date provides the point of reference described as the anchor date mentioned above.

 

For the example, the date rule Type is set to BEG_MONTH; selected individual months are Mar, Jun, Sep, and Dec; the Add Relative Months value is 3. January 1st has been made the anchor date to simplify explanation.

Nearest – The 3 relative months are added as follows:
If From Date is before January 1st, the system adds Jan, Feb and Apr.
If From Date is on or after January 1st, the system adds Feb, Apr and May.

Nearest-Relative – Similar to Nearest, except that in the case where the From Date is on or after January 1st, the system only adds Feb and Apr.
Fixed – The selected individual months are taken into account in the span of relative months, so only 2 months are added as follows:
If From Date is before January 1st, the system adds Jan and Feb.
If From Date is on or after January 1st, the system adds Feb and Apr.

Relative – The 3 relative months are added as follows:
If From Date is on or before January 1st, the system adds Jan, Feb and Apr.

If From Date is after January 1st, the system adds Feb, Apr and May.
Absolute – If we put 2 in the field Add Relative Months, the system will add Feb (Dec+2), May (Mar+2), Aug (June+2) and Nov (Sep+2).

 Ⓘ   [NOTE: Relative Types "Relative" and "Absolute" will both include the From Date (anchor date) in the schedule. Relative Types "Fixed," "Nearest," and "Nearest-Relative," on the other hand, roll to the next date in the sequence and do not include the From Date. When testing the date rule schedule, this becomes apparent after clicking the Next & Previous button, which shows results for the Next Date. For details on testing results for the date rule, see Testing a Date Rule.]

WeekDay

Select the day in the week for IMM, WEEKDAY_FIXED, or WEEKLY.

Rank

Select the rank of the weekday in the month for IMM, or in the week for WEEKLY: NONE, FIRST, SECOND, THIRD, FOURTH, LAST.

Date Roll

Select the date roll convention to roll the dates when "Bus Days" is checked, or when "Check Holidays" is checked.

Date Roll conventions are described under Help > Date Roll Conventions.

Bus

Cal

This only applies if you have populated "Add Days" to indicate whether to add business days or calendar days.

Bus Days

This only applies if you have populated "Add Days".

You can check the Bus Days checkbox to indicate that, before adding the specified number of days, if the date falls on a holiday, the system uses the specified Date Roll to roll to the following business day. Then the specified number of days are added.

Holidays

Click... to select holiday calendars to determine holidays when "Add Days" is populated. See "Add Days" for details.

Check Holiday

This only applies if you have populated "Add Days".

You can check "Check Holiday" when you want to check for holidays (after the calendar days have been added if any).

If you check "Check Holiday" the system will make sure that the new date is a business date. It is falls on a holiday, it will be rolled according to the date roll convention.

Relative

Only appears when the RELATIVE type has been selected.

Click ... to select a relative date rule. The new date rule is based on the relative date rule, with any specified adjustments.

For example, on the IMM futures market, trading dates are calculated from delivery dates. As the delivery date in most cases is defined as the 3rd Wednesday of Delivery Month and the last Trading date is 2 business days before Delivery date, you can define a trading rule based on the delivery date with Add days = equals –2 Bus.

Rules

Only appears when the DIFFERENCE, UNION or INTERSECTION types have been selected.

Click ... to select the date rules part of the difference, union or intersection.

Description

Enter a user-defined comment as needed.

From Date

To Date

In order to verify that the date rule definition is valid, you may generate all dates matching your rule between the From Date and the To Date fields.

See Testing a Date Rule for details.

 

Sample Usage

Typically, a date rule will be required to generate a schedule.

Sample swap details

 

2. Testing a Date Rule

» Select an existing date rule, and enter from and to dates.
» Then click Generate. The dates generated by the date rule will appear.

Sample date rule test

 

You can also click Next & Previous to view the next and the previous dates that the system would generate.

 

3. Modifying a Date Rule

» Select an existing date rule, and modify it as applicable.
» Then click Save to save your changes.

 

4. Deleting a Date Rule

» Click Delete. You will be prompted to select a date rule.

Note that if the date rule is in use, you will not be able to delete it.

 

5. Out-of-the-Box Custom Date Generators

To define the date rule, you must select the CUSTOM type, and then save it as the name of the custom generator, as in the example below.

Sample custom date generator

Calypso provides the following custom date generators out-of-the-box.

Generator / Date Rule Name

Description

Aluminum

Daily from cash to 3 months (first prompt date two working days from cash). Then every Wednesday from 3 months to 6 months. Then every third Wednesday from 7 months out to 27 months forward.

Define the holidays in the date rule.

CBOT_WHEAT_OPTION_EXPIRY

Pre-generated list of option expiry dates through 2040 for CBOT Wheat standard option contracts.

CBOT_WHEAT_SERIAL_OPTION_EXPIRY

Pre-generated list of option expiry dates through 2040 for CBOT Wheat serial option contracts.

CMEFeederCattle

Pre-generated list of last trading dates for CME Feeder Cattle Futures Contract.

CME_USDA_LASTTRADEDATE

Pre-generated list of last trading dates for CME USDA.

COMEX_JUNE_DEC_OPTION_EXPIRY

Expiration occurs on the fourth business day prior to the first day of June and December. If the expiration falls on a Friday or immediately prior to an Exchange holiday, expiration will occur on the previous business day.

Pre-generated list of option expiry dates through 2040.

COMEX_MONTHLY_OPTION_EXPIRY

Expiration occurs on the fourth business day prior to the first day of each month. If the expiration falls on a Friday or immediately prior to an Exchange holiday, expiration will occur on the previous business day.

Pre-generated list of option expiry dates through 2040.

COMEX_GOLD_MID_OPTION_EXPIRY

Expiration occurs on the fourth business day prior to the first day of February, April, June, August, October, and December. If the expiration falls on a Friday or immediately prior to an Exchange holiday, expiration will occur on the previous business day.

Pre-generated list of option expiry dates through 2040.

COMEX_SILVER_MID_OPTION_EXPIRY

Expiration occurs on the fourth business day prior to the first day of March, May, July, September, and December. If the expiration falls on a Friday or immediately prior to an Exchange holiday, expiration will occur on the previous business day.

Pre-generated list of option expiry dates through 2040.

ICE_ECX_LTD

Pre-generated list of last trading dates for the ICE Futures CFI Futures Contract.

ICE_LTD

Pre-generated list of last trading dates for the ICE Brent Crude futures contract.

ICE_LTD_FUTURE_OPTIONS

Pre-generated list of last trading dates for the ICE Brent Futures Options.

IMMCombined

Generates the expiry dates on CME Quarter and Serial Eurodollar Future Option contracts.

IMMNZD Generates expiration dates on NZD 90D Bank Bill Futures. The expiration dates fall on the first Wednesday after the 9th day of March, June, September, December. If the expiration date falls on an exchange holiday (specified by the selected holidays calendar configured on the Date Rule), the date is rolled using the FOLLOWING roll method to the next good business day.

 

 Ⓘ   [NOTE: The four COMEX rules can be used together in a RULE_SEQUENCE to generate the expiration dates for COMEX Precious Metal Option Expirations. Following is an example]

Generated Dates:

11/20/2008

12/23/2008

01/27/2009

02/24/2009

03/26/2009

04/27/2009

05/26/2009

07/28/2009

09/24/2009

11/23/2009

01/26/2010

03/25/2010

05/25/2010

07/27/2010

11/23/2010

05/25/2011

11/22/2011

05/24/2012

11/27/2012

02/25/2013

04/25/2013

06/25/2013

08/27/2013

Sample RULE_SEQUENCE

 

6. Custom Date Rule Tenor Shortcut Window

The Custom Date Rule Tenor Shortcut window allows you to assign a shortcut key to a pre-existing date rule so that a custom date rule based tenor can be used to quickly populate compatible date fields using the date rule.

From the Calypso Navigator, point to Configuration > Definitions > Custom Tenors (menu action refdata.CustomTenorShortcutWindow) and open the window to begin creating a custom date rule tenor shortcut.

Example of Tenor Shortcut window with saved shortcut keys associated with date rules.

 

6.1 Access Permissions

The following access permission functions are specific to the Custom Date Rule Tenor Shortcut window.

 

ViewCustomDateRuleTenors

Provides permission to open/view the Custom Date Rule Tenor Shortcuts window.

 

RemoveCustomDateRuleTenors

Provides permission to delete existing custom tenor configurations.

 

AddModifyCustomDateRuleTenors

Provides permission to create new or modify existing custom tenor configurations.

 

For details on assigning Access Permissions, see Access Permissions in Calypso User Security documentation.

 

6.2 Creating a Shortcut

» Click New to clear Shortcut Character and Date Rule fields and prepare for adding a new shortcut.
» In the Shortcut Character field, enter any letter a through z that is not already used by the system for shortcuts.

Exceptions are y, m, w, d, b, and i, which are used as shortcuts for year, month, week, day, business days, and IMM tenors.

» Click ... beside the Date Rule field to open the Select DateRule window, where you can select a date rule from all of those available in the system. Use the "Search text" field to filter date rules by text that begins the name of the date rule.

After highlighting a date rule in the list, click OK to close the Select DateRule window and populate the Date Rule field.

» You can click Open Date Rule to open the Date Rule window for the rule that is populated in the Date Rule field.
» Click Save to save the shortcut. It then appears in the table of shortcuts and associated date rules in the bottom portion of the window.
» You can select a row in this table and click Delete to remove the shortcut.

 Ⓘ   [NOTE: Manual date rules and rules that generate only one date are not supported.]

 

6.3 Using Custom Date Rule Tenor Shortcuts

The Custom Date Rule Tenor Shortcuts rely on an anchor date as a starting point for generating a date based on the date rule schedule. When using a shortcut for populating a Start Date, the shortcut uses the Valuation Date as the anchor. When using a shortcut for the End Date, the Start Date is the anchor.

 

To apply a shortcut, enter an integer in the date field followed by the letter associated with the date rule.

Then press Enter. The shortcut key applies the date rule and the integer determines how far out the date is and populates the date field accordingly.

 

The Custom Date Rule Tenor Shortcut feature is available in the following products and fields.

Swap Trade Window – Start Date, End Date
FRA Trade Window – Start Date, End Date
Swaption Trade Window – Underlying Swap Start Date, Underlying Swap End Date
Pricing Sheet strategies: Swap, FRA, Cap, Fixed Rate, Floating Rate – Start Date, End Date
Front Office Workstation components: Swap Pricer, Line Swap Pricer – Start Date, End Date