Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TWSE holidays for 2024 to Taiwan calendar #1847

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ql/time/calendars/taiwan.cpp
Original file line number Diff line number Diff line change
@@ -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/
@@ -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;
}

3 changes: 2 additions & 1 deletion ql/time/calendars/taiwan.hpp
Original file line number Diff line number Diff line change
@@ -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/
@@ -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>