Coverage Report

Created: 2026-02-03 07:02

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/time/calendars/mexico.hpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2005 StatPro Italia srl
5
 Copyright (C) 2024 Skandinaviska Enskilda Banken AB (publ)
6
7
 This file is part of QuantLib, a free-software/open-source library
8
 for financial quantitative analysts and developers - http://quantlib.org/
9
10
 QuantLib is free software: you can redistribute it and/or modify it
11
 under the terms of the QuantLib license.  You should have received a
12
 copy of the license along with this program; if not, please email
13
 <quantlib-dev@lists.sf.net>. The license is also available online at
14
 <https://www.quantlib.org/license.shtml>.
15
16
 This program is distributed in the hope that it will be useful, but WITHOUT
17
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18
 FOR A PARTICULAR PURPOSE.  See the license for more details.
19
*/
20
21
/*! \file mexico.hpp
22
    \brief Mexican calendars
23
*/
24
25
#ifndef quantlib_mexico_calendar_hpp
26
#define quantlib_mexico_calendar_hpp
27
28
#include <ql/time/calendar.hpp>
29
30
namespace QuantLib {
31
32
    //! %Mexican calendars
33
    /*! Holidays for the Mexican stock exchange
34
        (data from <http://www.bmv.com.mx/>):
35
        <ul>
36
        <li>Saturdays</li>
37
        <li>Sundays</li>
38
        <li>New Year's Day, January 1st</li>
39
        <li>Constitution Day, first Monday in February
40
            (February 5th before 2006)</li>
41
        <li>Birthday of Benito Juarez, third Monday in February
42
            (March 21st before 2006)</li>
43
        <li>Holy Thursday</li>
44
        <li>Good Friday</li>
45
        <li>Labour Day, May 1st</li>
46
        <li>National Day, September 16th</li>
47
        <li>Inauguration Day, October 1st, every sixth year starting 2024</li>
48
        <li>All Souls Day, November 2nd (bank holiday, not a public one)</li>
49
        <li>Revolution Day, third Monday in November
50
            (November 20th before 2006)</li>
51
        <li>Our Lady of Guadalupe, December 12th</li>
52
        <li>Christmas, December 25th</li>
53
        </ul>
54
55
        \ingroup calendars
56
    */
57
    class Mexico : public Calendar {
58
      private:
59
        class BmvImpl final : public Calendar::WesternImpl {
60
          public:
61
0
            std::string name() const override { return "Mexican stock exchange"; }
62
            bool isBusinessDay(const Date&) const override;
63
        };
64
      public:
65
        enum Market { BMV    //!< Mexican stock exchange
66
        };
67
        Mexico(Market m = BMV);
68
    };
69
70
}
71
72
73
#endif