Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
colombia.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2018 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
20
21namespace QuantLib {
22
24 // all calendar instances share the same implementation instance
25 static QuantLib::ext::shared_ptr<Calendar::Impl> impl(new Colombia::CseImpl);
26 impl_ = impl;
27}
28
29bool Colombia::CseImpl::isBusinessDay(const Date& date) const {
30 Weekday w = date.weekday();
31 Day d = date.dayOfMonth(), dd = date.dayOfYear();
32 Month m = date.month();
33 Year y = date.year();
34 Day em = easterMonday(y);
35 if (isWeekend(w)
36 // New Years Day
37 || ((d == 1 || (d == 2 && w == Monday)) && m == January)
38 // Dia de los Reyes Magos
39 || ((d >= 6 && d <= 12) && w == Monday && m == January)
40 // St. Josephs Day
41 || ((d >= 19 && d <= 25) && w == Monday && m == March)
42 // Maundy Thursday
43 || (dd == em - 4)
44 // Good Friday
45 || (dd == em - 3)
46 // Labour Day
47 || (d == 1 && m == May)
48 // Ascension Day
49 || (dd == em + 42)
50 // Corpus Christi
51 || (dd == em + 63)
52 // Sacred Heart
53 || (dd == em + 70)
54 // Saint Peter and Saint Paul
55 || (((d >= 29 && m == June) || (d <= 5 && m == July)) && w == Monday)
56 // Declaration of Independence
57 || (d == 20 && m == July)
58 // Battle of Boyaca
59 || (d == 7 && m == August)
60 // Assumption
61 || ((d >= 15 && d <= 21) && w == Monday && m == August)
62 // Colombus Day
63 || ((d >= 12 && d <= 18) && w == Monday && m == October)
64 // All Saints Day
65 || ((d >= 1 && d <= 7) && w == Monday && m == November)
66 // Independence of Cartagena
67 || ((d >= 12 && d <= 18) && w == Monday && m == November)
68 // Immaculate Conception
69 || (d == 8 && m == December)
70 // Christmas
71 || (d == 25 && m == December))
72 return false;
73 return true;
74}
75
76} // namespace QuantLib
bool isBusinessDay(const Date &) const override
Definition: colombia.cpp:29
Colombia(Market m=CSE)
Definition: colombia.cpp:23
Colombian calendar.