Skip to content

Commit

Permalink
Add TWSE holidays for 2024 to Taiwan calendar (#1847)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Dec 18, 2023
2 parents 350f69a + 3966f81 commit a33b3e0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions ql/time/calendars/taiwan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/*
Copyright (C) 2004 FIMAT Group
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 StatPro Italia srl
Copyright (C) 2023 Skandinaviska Enskilda Banken AB (publ)
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
Expand Down Expand Up @@ -440,6 +441,25 @@ namespace QuantLib {
return false;
}

if (y == 2024) {
if ( // adjusted holiday
(d == 8 && m == February)
// Lunar New Year
|| (d >= 9 && d <= 12 && m == February)
// adjusted holiday
|| (d >= 13 && d <= 14 && m == February)
// Children's Day
|| (d == 4 && m == April)
// Tomb-sweeping Day
|| (d == 5 && m == April)
// Dragon Boat Festival
|| (d == 10 && m == June)
// Mid-autumn/Moon Festival
|| (d == 17 && m == September)
)
return false;
}

return true;
}

Expand Down
3 changes: 2 additions & 1 deletion ql/time/calendars/taiwan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/*
Copyright (C) 2004 FIMAT Group
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 StatPro Italia srl
Copyright (C) 2023 Skandinaviska Enskilda Banken AB (publ)
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
Expand Down Expand Up @@ -42,7 +43,7 @@ namespace QuantLib {
</ul>
Other holidays for which no rule is given
(data available for 2002-2023 only:)
(data available for 2002-2024 only:)
<ul>
<li>Chinese Lunar New Year</li>
<li>Tomb Sweeping Day</li>
Expand Down

0 comments on commit a33b3e0

Please sign in to comment.