| 1 | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 | |
| 3 | /* |
| 4 | Copyright (C) 2021 Anubhav Pandey |
| 5 | |
| 6 | This file is part of QuantLib, a free-software/open-source library |
| 7 | for financial quantitative analysts and developers - http://quantlib.org/ |
| 8 | |
| 9 | QuantLib is free software: you can redistribute it and/or modify it |
| 10 | under the terms of the QuantLib license. You should have received a |
| 11 | copy of the license along with this program; if not, please email |
| 12 | <quantlib-dev@lists.sf.net>. The license is also available online at |
| 13 | <http://quantlib.org/license.shtml>. |
| 14 | |
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT |
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 17 | FOR A PARTICULAR PURPOSE. See the license for more details. |
| 18 | */ |
| 19 | |
| 20 | /*! \file chile.hpp |
| 21 | \brief Chilean calendars |
| 22 | */ |
| 23 | |
| 24 | #ifndef quantlib_chilean_calendar_hpp |
| 25 | #define quantlib_chilean_calendar_hpp |
| 26 | |
| 27 | #include <ql/time/calendar.hpp> |
| 28 | |
| 29 | namespace QuantLib { |
| 30 | |
| 31 | //! Chilean calendars |
| 32 | /*! Holidays for the Santiago Stock Exchange |
| 33 | (data from <https://en.wikipedia.org/wiki/Public_holidays_in_Chile>): |
| 34 | <ul> |
| 35 | <li>Saturdays</li> |
| 36 | <li>Sundays</li> |
| 37 | <li>New Year's Day, January 1st</li> |
| 38 | <li>January 2nd, when falling on a Monday (since 2017)</li> |
| 39 | <li>Good Friday</li> |
| 40 | <li>Easter Saturday</li> |
| 41 | <li>Labour Day, May 1st</li> |
| 42 | <li>Navy Day, May 21st</li> |
| 43 | <li>Day of Aboriginal People, June 21st (since 2021)</li> |
| 44 | <li>Saint Peter and Saint Paul, June 29th (moved to the nearest Monday if it falls on a weekday)</li> |
| 45 | <li>Our Lady of Mount Carmel, July 16th</li> |
| 46 | <li>Assumption Day, August 15th</li> |
| 47 | <li>Independence Day, September 18th (also the 17th if the latter falls on a Monday or Friday)</li> |
| 48 | <li>Army Day, September 19th (also the 20th if the latter falls on a Friday)</li> |
| 49 | <li>Discovery of Two Worlds, October 12th (moved to the nearest Monday if it falls on a weekday)</li> |
| 50 | <li>Reformation Day, October 31st (since 2008; moved to the preceding Friday if it falls on a Tuesday, |
| 51 | or to the following Friday if it falls on a Wednesday)</li> |
| 52 | <li>All Saints' Day, November 1st</li> |
| 53 | <li>Immaculate Conception, December 8th</li> |
| 54 | <li>Christmas Day, December 25th</li> |
| 55 | </ul> |
| 56 | |
| 57 | \ingroup calendars |
| 58 | */ |
| 59 | class Chile : public Calendar { |
| 60 | private: |
| 61 | class SseImpl final : public Calendar::WesternImpl { |
| 62 | public: |
| 63 | std::string name() const override { return "Santiago Stock Exchange" ; } |
| 64 | bool isBusinessDay(const Date&) const override; |
| 65 | }; |
| 66 | public: |
| 67 | enum Market { SSE //!< Santiago Stock Exchange |
| 68 | }; |
| 69 | Chile(Market m = SSE); |
| 70 | }; |
| 71 | |
| 72 | } |
| 73 | |
| 74 | |
| 75 | #endif |
| 76 | |