Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
france.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 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
21using namespace QuantLib;
22
23namespace QuantExt {
24
26 // all calendar instances share the same implementation instance
27 static QuantLib::ext::shared_ptr<Calendar::Impl> impl(new France::SettlementImpl);
28 impl_ = impl;
29}
30
31bool France::SettlementImpl::isBusinessDay(const Date& date) const {
32 Weekday w = date.weekday();
33 Day d = date.dayOfMonth(), dd = date.dayOfYear();
34 Month m = date.month();
35 Year y = date.year();
36 Day em = easterMonday(y);
37 if (isWeekend(w)
38 // New Years Day
39 || (d == 1 && m == January)
40 // Good Friday
41 || (dd == em - 3)
42 // Easter Monday
43 || (dd == em)
44 // Labour Day
45 || (d == 1 && m == May)
46 // Armistice (V-E) Day
47 || (d == 8 && m == May)
48 // Ascension Thursday
49 || (dd == em + 38)
50 // Whit Monday
51 || (dd == em + 49)
52 // Bastille Day
53 || (d == 14 && m == July)
54 // Assumption Day
55 || (d == 15 && m == August)
56 // All Saints' Day
57 || (d == 1 && m == November)
58 // Armistice Day
59 || (d == 11 && m == November)
60 // Christmas
61 || (d == 25 && m == December)
62 // Boxing Day
63 || (d == 26 && m == December))
64 return false;
65 return true;
66}
67
68} // namespace QuantExt
bool isBusinessDay(const Date &) const override
Definition: france.cpp:31
France(Market m=Settlement)
Definition: france.cpp:25
French calendar.