Skip to content

Commit

Permalink
update hk calendar (#1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Apr 26, 2023
2 parents 647528e + 1735e07 commit e6a4bfc
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions ql/time/calendars/hongkong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,60 @@ 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
((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;
}

// 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
((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;
}

Expand Down

0 comments on commit e6a4bfc

Please sign in to comment.