I got the results with the question marks because St. Patrick Day is present in the CATO holiday calendar? How do I get the HolidayCalendar to act only on the banking holidays?
The CATO holiday data is intended to match the fixings of the CDOR and CORRA indices. If it is wrong, then it should be fixed. However, in this case, 2017-04-17 is Easter Monday, which I believe is a valid holiday. You can see the code here:
If you need to replace the data, you can use HolidayCalendarData.ini.
Markets are open on Easter Monday.
What I’m trying to do is to correctly set the settlement date based on T … T+3 rules. I can’t settle correctly if I consider Easter Monday a holiday. In Toronto…
I changed the subject to point to Easter Monday instead of St Patrick day (I did test that one too)
The Benchmark will be published at 10:15 am ET each Business Day, subject to any delay as set forth in section 2.4 below. A Business Day means any day on which Schedule 1 banks under the Bank Act (Canada) are open for business in Toronto, Ontario, Canada
Looking at some bank websites, it seems that Easter Monday is not a holiday. Unfortunately, the CDOR fixings do not seem to be public, so they can’t be checked.
If you like, you could submit a pull request to remove the two Easter Monday lines from GlobalHolidayCalendar and fix the associated test.
In the meantime, you have two options - create a new holiday calendar, or edit the Strata source code and build a local release.
To create your own holiday calendar, create a file named HolidayCalendarData.ini in the classpath location com/opengamma/strata/config/application. It should have the contents:
[MyCATO]
2016-01-01
2016-12-25
Weekend = Sat,Sun
with whatever holiday dates you want. See the existing (empty) HolidayCalendarData.ini file for more details of the format.
Note that you have to use a different name - MyCATO, not CATO. This is another bug, caused by unexpected behaviour in Google’s Guava library. I’ll be fixing that bug.
I will speak to my BAs and get the source of our business holidays to post it here.
That data we store in a table and currently load into our apps using objectlab toolkit.
I thought I could use the Starta HolidayCalendar as is but I’ll follow your suggestion and eventually generate a HolidayCalendarData.ini file from the DB to be loaded.
Is there a property that I can set to point to the location of the file? com.opengamma.strata.config.directories?
The Strata holiday data is intended for evaluation purposes rather than production. As part of our commercial work will will be providing integration with well-known holiday calendar sources.
As I mentioned above, a file has to be added to the classpath to change the holiday calendars. The simplest form I described above. Alternative approaches can refer to a Java class that loads the data from an arbitrary location if that is desired. See ExtendedEnum and NamedLookup.
I ended up creating a new Holiday calendar (named after our company) and a “Early close” calendar as well (since I were at it ) together with their associated HolidayCalendarId’s
If I call the above i get an exception saying it cannot resolve the calendar from the ID.
Truth is, I didn’t looked to deep into the sources being busy with a release.