28 static ext::shared_ptr<Calendar::Impl> settlementImpl(
30 static ext::shared_ptr<Calendar::Impl> exchangeImpl(
35 impl_ = settlementImpl;
47 bool isExtraHolidaySettlementImpl(
Day d,
Month month,
Year year) {
52 case May:
return d == 8;
54 default:
return false;
59 case April:
return d == 30;
60 case May:
return d == 2;
61 case June:
return d == 11;
63 default:
return false;
67 case May:
return d == 2 ||
d == 3 ||
d == 10;
68 default:
return false;
72 case March:
return d == 30 ||
d == 31;
73 case April:
return d == 1 ||
d == 2 ||
d == 3;
74 case May:
return d == 4 ||
d == 5;
75 default:
return false;
96 || ((
d == 7 || ((
d == 8 ||
d == 9) && w ==
Monday)) &&
99 || ((
d == 23 || ((
d == 24 ||
d == 25) && w ==
Monday)) &&
102 || ((
d == 8 || ((
d == 9 ||
d == 10) && w ==
Monday)) &&
105 || ((
d == 1 || ((
d == 2 ||
d == 3) && w ==
Monday)) &&
108 || ((
d == 9 || ((
d == 10 ||
d == 11) && w ==
Monday)) &&
111 || ((
d == 12 || ((
d == 13 ||
d == 14) && w ==
Monday)) &&
114 || ((
d == 4 || ((
d == 5 ||
d == 6) && w ==
Monday)) &&
118 if (isExtraHolidaySettlementImpl(
d,m,
y))
130 case March:
return d == 11;
131 case April:
return d == 28;
132 case May:
return d == 5 ||
d == 12;
133 case June:
return d == 9;
134 default:
return false;
140 default:
return false;
144 case April:
return d == 28;
145 case June:
return d == 9;
147 default:
return false;
154 bool isExtraHolidayExchangeImpl(
Day d,
Month month,
Year year) {
159 case March:
return d == 9;
160 case April:
return d == 30;
161 case June:
return d == 11;
162 default:
return false;
166 case January:
return d == 1 ||
d == 2 ||
d == 3
168 default:
return false;
172 case January:
return d == 1 ||
d == 2 ||
d == 3 ||
d == 7;
173 default:
return false;
177 case January:
return d == 1 ||
d == 2 ||
d == 7;
178 default:
return false;
183 case January:
return d == 1 ||
d == 7 ||
d == 8;
184 case May:
return d == 2 ||
d == 3;
185 case June:
return d == 13;
187 default:
return false;
192 case May:
return d == 8;
193 default:
return false;
197 case January:
return d == 1 ||
d == 2 ||
d == 8;
199 default:
return false;
203 case January:
return d == 1 ||
d == 2 ||
d == 7;
205 default:
return false;
209 case January:
return d == 1 ||
d == 2 ||
d == 7;
211 case June:
return d == 24;
212 case July:
return d == 1;
213 default:
return false;
231 QL_FAIL(
"MOEX calendar for the year " <<
y
232 <<
" does not exist.");
234 if (isWorkingWeekend(
d,m,
y))
242 || ((
d == 8 || ((
d == 9 ||
d == 10) && w ==
Monday)) && m ==
March)
244 || (
d == 1 && m ==
May)
246 || ((
d == 9 || ((
d == 10 ||
d == 11) && w ==
Monday)) && m ==
May)
248 || (
d == 12 && m ==
June)
250 || ((
d == 4 || ((
d == 5 ||
d == 6) && w ==
Monday))
256 if (isExtraHolidayExchangeImpl(
d,m,
y))
bool isWeekend(Weekday) const override
bool isWeekend(Weekday w) const
ext::shared_ptr< Impl > impl_
bool isBusinessDay(const Date &) const override
bool isBusinessDay(const Date &) const override
Russia(Market=Settlement)
@ MOEX
Moscow Exchange calendar.
@ Settlement
generic settlement calendar
Classes and functions for error handling.
#define QL_FAIL(message)
throw an error (possibly with file and line information)