QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
brazil.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2005, 2006 Piter Dias
5 Copyright (C) 2007 Richard Gomes
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 <http://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 brazil.hpp
22 \brief Brazilian calendar
23*/
24
25#ifndef quantlib_brazilian_calendar_hpp
26#define quantlib_brazilian_calendar_hpp
27
28#include <ql/time/calendar.hpp>
29
30namespace QuantLib {
31
32 //! Brazilian calendar
33 /*! Banking holidays:
34 <ul>
35 <li>Saturdays</li>
36 <li>Sundays</li>
37 <li>New Year's Day, January 1st</li>
38 <li>Tiradentes's Day, April 21th</li>
39 <li>Labour Day, May 1st</li>
40 <li>Independence Day, September 7th</li>
41 <li>Nossa Sra. Aparecida Day, October 12th</li>
42 <li>All Souls Day, November 2nd</li>
43 <li>Republic Day, November 15th</li>
44 <li>Black Awareness Day, November 20th (since 2024)</li>
45 <li>Christmas, December 25th</li>
46 <li>Passion of Christ</li>
47 <li>Carnival</li>
48 <li>Corpus Christi</li>
49 </ul>
50
51 Holidays for the Bovespa stock exchange
52 <ul>
53 <li>Saturdays</li>
54 <li>Sundays</li>
55 <li>New Year's Day, January 1st</li>
56 <li>Sao Paulo City Day, January 25th (up to 2021 included)</li>
57 <li>Tiradentes's Day, April 21th</li>
58 <li>Labour Day, May 1st</li>
59 <li>Revolution Day, July 9th</li>
60 <li>Independence Day, September 7th</li>
61 <li>Nossa Sra. Aparecida Day, October 12th</li>
62 <li>All Souls Day, November 2nd</li>
63 <li>Republic Day, November 15th</li>
64 <li>Black Consciousness Day, November 20th (since 2007)</li>
65 <li>Christmas Eve, December 24th</li>
66 <li>Christmas, December 25th</li>
67 <li>Passion of Christ</li>
68 <li>Carnival</li>
69 <li>Corpus Christi</li>
70 <li>the last business day of the year</li>
71 </ul>
72
73 \ingroup calendars
74
75 \test the correctness of the returned results is tested
76 against a list of known holidays.
77 */
78 class Brazil : public Calendar {
79 private:
81 public:
82 std::string name() const override { return "Brazil"; }
83 bool isBusinessDay(const Date&) const override;
84 };
85 class ExchangeImpl final : public Calendar::WesternImpl {
86 public:
87 std::string name() const override { return "BOVESPA"; }
88 bool isBusinessDay(const Date&) const override;
89 };
90 public:
91 //! Brazilian calendars
92 enum Market { Settlement, //!< generic settlement calendar
93 Exchange //!< BOVESPA calendar
94 };
95 Brazil(Market market = Settlement);
96 };
97
98}
99
100
101#endif
102
calendar class
bool isBusinessDay(const Date &) const override
Definition: brazil.cpp:83
std::string name() const override
Definition: brazil.hpp:87
bool isBusinessDay(const Date &) const override
Definition: brazil.cpp:45
std::string name() const override
Definition: brazil.hpp:82
Brazilian calendar.
Definition: brazil.hpp:78
Market
Brazilian calendars.
Definition: brazil.hpp:92
@ Settlement
generic settlement calendar
Definition: brazil.hpp:92
@ Exchange
BOVESPA calendar.
Definition: brazil.hpp:93
partial calendar implementation
Definition: calendar.hpp:168
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
Definition: any.hpp:35
settlement information
Definition: swaption.hpp:41