QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
time
calendars
canada.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) 2000, 2001, 2002, 2003 RiskMap srl
5
Copyright (C) 2007 StatPro Italia srl
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 canada.hpp
22
\brief Canadian calendar
23
*/
24
25
#ifndef quantlib_canadian_calendar_hpp
26
#define quantlib_canadian_calendar_hpp
27
28
#include <
ql/time/calendar.hpp
>
29
30
namespace
QuantLib
{
31
32
//! Canadian calendar
33
/*! Banking holidays
34
(data from <http://www.bankofcanada.ca/en/about/holiday.html>):
35
<ul>
36
<li>Saturdays</li>
37
<li>Sundays</li>
38
<li>New Year's Day, January 1st (possibly moved to Monday)</li>
39
<li>Family Day, third Monday of February (since 2008)</li>
40
<li>Good Friday</li>
41
<li>Victoria Day, the Monday on or preceding May 24th</li>
42
<li>Canada Day, July 1st (possibly moved to Monday)</li>
43
<li>Provincial Holiday, first Monday of August</li>
44
<li>Labour Day, first Monday of September</li>
45
<li>National Day for Truth and Reconciliation, September 30th (possibly moved to Monday)</li>
46
<li>Thanksgiving Day, second Monday of October</li>
47
<li>Remembrance Day, November 11th (possibly moved to Monday)</li>
48
<li>Christmas, December 25th (possibly moved to Monday or Tuesday)</li>
49
<li>Boxing Day, December 26th (possibly moved to Monday or
50
Tuesday)</li>
51
</ul>
52
53
Holidays for the Toronto stock exchange
54
(data from <http://www.tsx.com/en/about_tsx/market_hours.html>):
55
<ul>
56
<li>Saturdays</li>
57
<li>Sundays</li>
58
<li>New Year's Day, January 1st (possibly moved to Monday)</li>
59
<li>Family Day, third Monday of February (since 2008)</li>
60
<li>Good Friday</li>
61
<li>Victoria Day, the Monday on or preceding May 24th</li>
62
<li>Canada Day, July 1st (possibly moved to Monday)</li>
63
<li>Provincial Holiday, first Monday of August</li>
64
<li>Labour Day, first Monday of September</li>
65
<li>Thanksgiving Day, second Monday of October</li>
66
<li>Christmas, December 25th (possibly moved to Monday or Tuesday)</li>
67
<li>Boxing Day, December 26th (possibly moved to Monday or
68
Tuesday)</li>
69
</ul>
70
71
\ingroup calendars
72
*/
73
class
Canada
:
public
Calendar
{
74
private
:
75
class
SettlementImpl
final :
public
Calendar::WesternImpl
{
76
public
:
77
std::string
name
()
const override
{
return
"Canada"
; }
78
bool
isBusinessDay
(
const
Date
&)
const override
;
79
};
80
class
TsxImpl
final :
public
Calendar::WesternImpl
{
81
public
:
82
std::string
name
()
const override
{
return
"TSX"
; }
83
bool
isBusinessDay
(
const
Date
&)
const override
;
84
};
85
public
:
86
enum
Market
{
Settlement
,
//!< generic settlement calendar
87
TSX
//!< Toronto stock exchange calendar
88
};
89
Canada
(
Market
market =
Settlement
);
90
};
91
92
}
93
94
95
#endif
calendar.hpp
calendar class
QuantLib::Calendar::WesternImpl
partial calendar implementation
Definition:
calendar.hpp:168
QuantLib::Calendar
calendar class
Definition:
calendar.hpp:61
QuantLib::Canada::SettlementImpl
Definition:
canada.hpp:75
QuantLib::Canada::SettlementImpl::isBusinessDay
bool isBusinessDay(const Date &) const override
Definition:
canada.cpp:43
QuantLib::Canada::SettlementImpl::name
std::string name() const override
Definition:
canada.hpp:77
QuantLib::Canada::TsxImpl
Definition:
canada.hpp:80
QuantLib::Canada::TsxImpl::isBusinessDay
bool isBusinessDay(const Date &) const override
Definition:
canada.cpp:84
QuantLib::Canada::TsxImpl::name
std::string name() const override
Definition:
canada.hpp:82
QuantLib::Canada
Canadian calendar.
Definition:
canada.hpp:73
QuantLib::Canada::Market
Market
Definition:
canada.hpp:86
QuantLib::Canada::TSX
@ TSX
Toronto stock exchange calendar.
Definition:
canada.hpp:87
QuantLib::Canada::Settlement
@ Settlement
generic settlement calendar
Definition:
canada.hpp:86
QuantLib::Date
Concrete date class.
Definition:
date.hpp:125
QuantLib
Definition:
any.hpp:35
QuantLib::Settlement
settlement information
Definition:
swaption.hpp:41
Generated by
Doxygen
1.9.5