Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ireland::IrishStockExchangeImpl Class Reference
+ Inheritance diagram for Ireland::IrishStockExchangeImpl:
+ Collaboration diagram for Ireland::IrishStockExchangeImpl:

Public Member Functions

std::string name () const override
 
bool isBusinessDay (const QuantLib::Date &) const override
 

Detailed Description

Definition at line 56 of file ireland.hpp.

Member Function Documentation

◆ name()

std::string name ( ) const
override

Definition at line 58 of file ireland.hpp.

58{ return "IrishStockExchange"; }

◆ isBusinessDay()

bool isBusinessDay ( const QuantLib::Date &  ) const
override

Definition at line 40 of file ireland.cpp.

40 {
41 Weekday w = date.weekday();
42 Day d = date.dayOfMonth(), dd = date.dayOfYear();
43 Month m = date.month();
44 Year y = date.year();
45 Day em = easterMonday(y);
46
47 if (isWeekend(w)
48 // New Year's Day (possibly moved to Monday)
49 || ((d == 1 || ((d == 2 || d == 3) && w == Monday)) && m == January)
50 // Good Friday
51 || (dd == em - 3)
52 // Easter Monday
53 || (dd == em)
54 // St. Patrick's Day (possibly moved to Monday)
55 || (m == Mar && ((d == 17) || ((d == 18 || d == 19) && w == Monday)))
56 // first Monday of May
57 || (m == May && d == Date::nthWeekday(1, Monday, May, y).dayOfMonth())
58 // first Monday of June
59 || (m == June && d == Date::nthWeekday(1, Monday, June, y).dayOfMonth())
60 // first Monday of August
61 || (m == August && d == Date::nthWeekday(1, Monday, August, y).dayOfMonth())
62 // last Monday of October
63 || (m == October && d == DateUtilities::lastWeekday(Monday, October, y).dayOfMonth())
64 // Christmas (possibly moved to Monday or Tuesday)
65 || ((d == 25 || (d == 27 && (w == Monday || w == Tuesday))) && m == December)
66 // Boxing Day (possibly moved to Monday or Tuesday)
67 || ((d == 26 || (d == 28 && (w == Monday || w == Tuesday))) && m == December))
68 return false; // NOLINT(readability-simplify-boolean-expr)
69 return true;
70}
Date lastWeekday(Weekday dayOfWeek, Month m, Year y)
+ Here is the call graph for this function:
+ Here is the caller graph for this function: