Coverage Report

Created: 2025-08-11 06:28

/src/quantlib/ql/time/calendars/chile.hpp
Line
Count
Source (jump to first uncovered line)
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, around June 21st (observed on each Winter Solstice) (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
        <li>New Year's Eve, December 31st; (see https://www.cmfchile.cl/portal/prensa/615/w3-article-49984.html)</li>
56
        </ul>
57
58
        \ingroup calendars
59
    */
60
    class Chile : public Calendar {
61
      private:
62
        class SseImpl final : public Calendar::WesternImpl {
63
          public:
64
0
            std::string name() const override { return "Santiago Stock Exchange"; }
65
            bool isBusinessDay(const Date&) const override;
66
        };
67
      public:
68
        enum Market { SSE    //!< Santiago Stock Exchange
69
        };
70
        Chile(Market m = SSE);
71
    };
72
73
}
74
75
76
#endif