4
$\begingroup$

I am aware of QuantLib's functions addHoliday() and removeHoliday(), but I am wondering if there is a better way to edit the calendar permanently. How does one check and add days to the QuantLib calendars?

For example, Taiwan's market took a holiday for a typhoon, and maybe I'd like to add that day to the calendar (to take effect across all my software). Or for another example, Japan celebrated its first Mountain Day this past year, but I don't know if is taken into account in my version of QuantLib::Calendar Japan().

Is there a straightforward way to view/correct a particular calendar NOT during runtime?

$\endgroup$

1 Answer 1

4
$\begingroup$

If you want to change the calendars at compile time you can edit the respective .cpp file in ql/time/calendars/ - e.g. germany.cpp. Here you find the different isBusinessDay(...) implementations for the respective country.

$\endgroup$
3
  • 2
    $\begingroup$ After which, you can send a pull request to github.com/lballabio/QuantLib so that the new holiday is permanently included in the library. $\endgroup$ Nov 8, 2016 at 8:38
  • $\begingroup$ @LuigiBallabio holiday calendars sometimes change on a short notice. For example, president Grorge H.W.Bush died on 11/30/2018; President Trump declared the following Wedesday, 22/05/2018, a national day of mourning; and this became a non-working day for trades using this calender. Likewise London calendar gets royal Jubilees announced on short notice. It is also a good practice, although rare, to report the P&L attributable to the calendar change (calendar01). $\endgroup$ Jun 16, 2020 at 11:34
  • $\begingroup$ For that, you'd use the addHoliday method mentioned in the question. $\endgroup$ Jun 16, 2020 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.