From 88084ebf4abe6b9e25daf194248e4400469ba432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Fr=C3=A8rebeau?= Date: Tue, 25 Apr 2023 18:17:51 +0200 Subject: [PATCH 1/2] update hk calendar --- ql/time/calendars/hongkong.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ql/time/calendars/hongkong.cpp b/ql/time/calendars/hongkong.cpp index 7b5d4283659..9b01514204a 100644 --- a/ql/time/calendars/hongkong.cpp +++ b/ql/time/calendars/hongkong.cpp @@ -329,6 +329,40 @@ namespace QuantLib { return false; } + if (y == 2022) + { + if (// Lunar New Year + ((d >= 1 && d <= 3) && m == February) + // Ching Ming Festival + || (d == 5 && m == April) + // Buddha's birthday + || (d == 9 && m == May) + // Tuen Ng festival + || (d == 3 && m == June) + // Mid-autumn festival + || (d == 12 && m == September) + // Chung Yeung festival + || (d == 4 && m == October)) + return false; + } + + if (y == 2023) + { + if (// Lunar New Year + ((d >= 23 && d <= 25) && m == January) + // Ching Ming Festival + || (d == 5 && m == April) + // Buddha's birthday + || (d == 26 && m == May) + // Tuen Ng festival + || (d == 22 && m == June) + // Mid-autumn festival + || (d == 12 && m == September) + // Chung Yeung festival + || (d == 4 && m == October)) + return false; + } + return true; } From 1735e07b5b515c63061e10e5c2e55588f00aeb9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Fr=C3=A8rebeau?= Date: Wed, 26 Apr 2023 11:22:51 +0200 Subject: [PATCH 2/2] HKEx calendar update --- ql/time/calendars/hongkong.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ql/time/calendars/hongkong.cpp b/ql/time/calendars/hongkong.cpp index 9b01514204a..ab22dde919f 100644 --- a/ql/time/calendars/hongkong.cpp +++ b/ql/time/calendars/hongkong.cpp @@ -329,6 +329,25 @@ namespace QuantLib { return false; } + // data from https://www.hkex.com.hk/-/media/hkex-market/services/circulars-and-notices/participant-and-members-circulars/sehk/2020/ce_sehk_ct_038_2020.pdf + if (y == 2021) + { + if (// Lunar New Year + ((d == 12 || d == 15) && m == February) + // Ching Ming Festival + || (d == 5 && m == April) + // Buddha's birthday + || (d == 19 && m == May) + // Tuen Ng festival + || (d == 14 && m == June) + // Mid-autumn festival + || (d == 22 && m == September) + // Chung Yeung festival + || (d == 14 && m == October)) + return false; + } + + // data from https://www.hkex.com.hk/-/media/HKEX-Market/Services/Circulars-and-Notices/Participant-and-Members-Circulars/SEHK/2021/ce_SEHK_CT_082_2021.pdf if (y == 2022) { if (// Lunar New Year @@ -346,6 +365,7 @@ namespace QuantLib { return false; } + // data from https://www.hkex.com.hk/-/media/HKEX-Market/Services/Circulars-and-Notices/Participant-and-Members-Circulars/SEHK/2022/ce_SEHK_CT_058_2022.pdf if (y == 2023) { if (// Lunar New Year