pandas-market-calendars 4.3.0__py3-none-any.whl → 4.3.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. pandas_market_calendars/calendars/__init__.py +0 -0
  2. pandas_market_calendars/calendars/asx.py +63 -0
  3. pandas_market_calendars/calendars/bmf.py +227 -0
  4. pandas_market_calendars/calendars/bse.py +409 -0
  5. pandas_market_calendars/calendars/cboe.py +115 -0
  6. pandas_market_calendars/calendars/cme.py +240 -0
  7. pandas_market_calendars/calendars/cme_globex_agriculture.py +103 -0
  8. pandas_market_calendars/calendars/cme_globex_base.py +103 -0
  9. pandas_market_calendars/calendars/cme_globex_crypto.py +147 -0
  10. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +138 -0
  11. pandas_market_calendars/calendars/cme_globex_equities.py +104 -0
  12. pandas_market_calendars/calendars/cme_globex_fixed_income.py +113 -0
  13. pandas_market_calendars/calendars/cme_globex_fx.py +78 -0
  14. pandas_market_calendars/calendars/eurex.py +119 -0
  15. pandas_market_calendars/calendars/hkex.py +408 -0
  16. pandas_market_calendars/calendars/ice.py +65 -0
  17. pandas_market_calendars/calendars/iex.py +98 -0
  18. pandas_market_calendars/calendars/jpx.py +103 -0
  19. pandas_market_calendars/calendars/lse.py +91 -0
  20. pandas_market_calendars/calendars/mirror.py +114 -0
  21. pandas_market_calendars/calendars/nyse.py +1127 -0
  22. pandas_market_calendars/calendars/ose.py +150 -0
  23. pandas_market_calendars/calendars/sifma.py +297 -0
  24. pandas_market_calendars/calendars/six.py +114 -0
  25. pandas_market_calendars/calendars/sse.py +290 -0
  26. pandas_market_calendars/calendars/tase.py +195 -0
  27. pandas_market_calendars/calendars/tsx.py +159 -0
  28. pandas_market_calendars/holidays/__init__.py +0 -0
  29. pandas_market_calendars/holidays/cme.py +340 -0
  30. pandas_market_calendars/holidays/cme_globex.py +198 -0
  31. pandas_market_calendars/holidays/cn.py +1436 -0
  32. pandas_market_calendars/holidays/jp.py +396 -0
  33. pandas_market_calendars/holidays/jpx_equinox.py +147 -0
  34. pandas_market_calendars/holidays/nyse.py +1472 -0
  35. pandas_market_calendars/holidays/oz.py +65 -0
  36. pandas_market_calendars/holidays/sifma.py +321 -0
  37. pandas_market_calendars/holidays/uk.py +180 -0
  38. pandas_market_calendars/holidays/us.py +360 -0
  39. {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/METADATA +1 -1
  40. pandas_market_calendars-4.3.1.dist-info/RECORD +49 -0
  41. pandas_market_calendars-4.3.0.dist-info/RECORD +0 -11
  42. {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/LICENSE +0 -0
  43. {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/NOTICE +0 -0
  44. {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/WHEEL +0 -0
  45. {pandas_market_calendars-4.3.0.dist-info → pandas_market_calendars-4.3.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1472 @@
1
+ import pandas as pd
2
+ from dateutil.relativedelta import (MO, TH, TU)
3
+ from pandas import (DateOffset, Timestamp, date_range)
4
+ from datetime import timedelta
5
+ from pandas.tseries.holiday import (Holiday, nearest_workday, sunday_to_monday, Easter)
6
+ from pandas.tseries.offsets import Day, CustomBusinessDay
7
+
8
+ from pandas_market_calendars.market_calendar import ( MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY)
9
+
10
+ ################################################################################################
11
+ # main reference:
12
+ # https://github.com/rsheftel/pandas_market_calendars/files/6827110/Stocks.NYSE-Closings.pdf
13
+ #
14
+ # See nyse.py for details
15
+ #################################################################################################
16
+
17
+ def previous_saturday(dt):
18
+ """
19
+ If holiday falls on Sunday, Monday or Tuesday, Saturday there is no trading
20
+ """
21
+ if dt.weekday() == MONDAY:
22
+ return dt - timedelta(2)
23
+ elif dt.weekday() == TUESDAY:
24
+ return dt - timedelta(3)
25
+ elif dt.weekday() == SUNDAY:
26
+ return dt - timedelta(1)
27
+ return dt
28
+
29
+ def next_saturday(dt):
30
+ """
31
+ If holiday falls on Thursday or Friday, the next Saturday there is no trading
32
+ """
33
+ if dt.weekday() == THURSDAY:
34
+ return dt + timedelta(2)
35
+ elif dt.weekday() == FRIDAY:
36
+ return dt + timedelta(1)
37
+ return dt
38
+
39
+ ####################################################
40
+ # US New Years Day Jan 1
41
+ # Closed every year since the stock market opened
42
+ #####################################################
43
+ USNewYearsDayNYSEpost1952 = Holiday(
44
+ 'New Years Day',
45
+ month=1,
46
+ day=1,
47
+ start_date = Timestamp('1952-09-29'),
48
+ # When Jan 1 is a Sunday, US markets observe the subsequent Monday.
49
+ # When Jan 1 is a Saturday (as in 2005 and 2011), no holiday is observed.
50
+ observance=sunday_to_monday,
51
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY,)
52
+ )
53
+
54
+ USNewYearsDayNYSEpre1952 = Holiday(
55
+ 'New Years Day Before Saturday Trading Ceased',
56
+ month=1,
57
+ day=1,
58
+ end_date = Timestamp('1952-09-28'),
59
+ observance=sunday_to_monday,
60
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY,)
61
+ )
62
+
63
+ NewYearsEve1pmCloseAdhoc = [
64
+ #Timestamp('1999-12-31', tz='UTC'), # Disputed. Not in reference source
65
+ ]
66
+
67
+ # Not every Saturday before/after Christmas is a holiday
68
+ SatBeforeNewYearsAdhoc = [
69
+ Timestamp('1916-12-30', tz='UTC')
70
+ ]
71
+
72
+ USMartinLutherKingJrAfter1998 = Holiday(
73
+ 'Dr. Martin Luther King Jr. Day',
74
+ month=1,
75
+ day=1,
76
+ # The US markets didn't observe MLK day as a holiday until 1998.
77
+ start_date=Timestamp('1998-01-01'),
78
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY,),
79
+ offset=DateOffset(weekday=MO(3)),
80
+ )
81
+ #########################################################################
82
+ # US Presidents Day Feb
83
+ # Lincoln's birthday closed every year 1896-1953
84
+ # Washington's birthday closed every year. Observed Mondays since 1971
85
+ # Grant's birthday was celebrated once in 1897
86
+ ##########################################################################
87
+ USPresidentsDay = Holiday('President''s Day',
88
+ start_date=Timestamp('1971-01-01'),
89
+ month=2, day=1,
90
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY,),
91
+ offset=DateOffset(weekday=MO(3)))
92
+
93
+ USWashingtonsBirthDayBefore1952 = Holiday(
94
+ 'Washington''s Birthday',
95
+ month=2,
96
+ day=22,
97
+ end_date=Timestamp('1952-09-28'),
98
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY,),
99
+ observance=sunday_to_monday,
100
+ )
101
+ USWashingtonsBirthDay1952to1963 = Holiday(
102
+ 'Washington''s Birthday',
103
+ month=2,
104
+ day=22,
105
+ start_date=Timestamp('1952-09-29'),
106
+ end_date=Timestamp('1963-12-31'),
107
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY,),
108
+ observance=sunday_to_monday,
109
+ )
110
+
111
+ USWashingtonsBirthDay1964to1970 = Holiday(
112
+ 'Washington''s Birthday',
113
+ month=2,
114
+ day=22,
115
+ start_date=Timestamp('1964-01-01'),
116
+ end_date=Timestamp('1970-12-31'),
117
+ observance=nearest_workday,
118
+ )
119
+ # Not all Saturdays before Washingtons birthday were holidays (e.g. 1920)
120
+ SatBeforeWashingtonsBirthdayAdhoc = [
121
+ Timestamp('1903-02-21', tz='UTC'),
122
+ ]
123
+ # Not all Saturdays after Washington's brithday were holidays (e.g. 1918)
124
+ SatAfterWashingtonsBirthdayAdhoc = [
125
+ Timestamp('1901-02-23', tz='UTC'),
126
+ Timestamp('1907-02-23', tz='UTC'),
127
+ Timestamp('1929-02-23', tz='UTC'),
128
+ Timestamp('1946-02-23', tz='UTC')
129
+ ]
130
+
131
+ USLincolnsBirthDayBefore1954 = Holiday(
132
+ 'Lincoln''s Birthday',
133
+ month=2,
134
+ day=12,
135
+ start_date=Timestamp('1896-01-01'),
136
+ end_date=Timestamp('1953-12-31'),
137
+ observance=sunday_to_monday,
138
+ )
139
+ # Not all Saturdays before/after Lincoln's birthday were holidays
140
+ SatBeforeAfterLincolnsBirthdayAdhoc = [
141
+ Timestamp('1899-02-11', tz='UTC'),
142
+ Timestamp('1909-02-13', tz='UTC')
143
+ ]
144
+
145
+ # 1968-02-12. Offices were open but trading floor was closed
146
+ LincolnsBirthDayAdhoc = [Timestamp('1968-02-12', tz='UTC')]
147
+
148
+ GrantsBirthDayAdhoc = [Timestamp('1897-04-27', tz='UTC')]
149
+
150
+ ############################################################
151
+ # Good Friday
152
+ # closed every year except 1898, 1906, and 1907
153
+ ############################################################
154
+ GoodFriday = Holiday(
155
+ "Good Friday 1908+",
156
+ start_date=Timestamp('1908-01-01'),
157
+ month=1,
158
+ day=1,
159
+ offset=[Easter(), Day(-2)]
160
+ )
161
+ GoodFridayPre1898 = Holiday(
162
+ "Good Friday Before 1898",
163
+ start_date=Timestamp('1885-01-01'),
164
+ end_date=Timestamp('1897-12-31'),
165
+ month=1,
166
+ day=1,
167
+ offset=[Easter(), Day(-2)]
168
+ )
169
+ GoodFriday1899to1905 = Holiday(
170
+ "Good Friday 1899 to 1905",
171
+ start_date=Timestamp('1899-01-01'),
172
+ end_date=Timestamp('1905-12-31'),
173
+ month=1,
174
+ day=1,
175
+ offset=[Easter(), Day(-2)]
176
+ )
177
+ #Not every saturday after Good Friday is a holiday (e.g. 1904)
178
+ SatAfterGoodFridayAdhoc = [
179
+ Timestamp("1900-04-14", tz='UTC'),
180
+ Timestamp("1901-04-06", tz='UTC'),
181
+ Timestamp("1902-03-29", tz='UTC'),
182
+ Timestamp("1903-04-11", tz='UTC'),
183
+ Timestamp("1905-04-22", tz='UTC'),
184
+ Timestamp("1907-03-30", tz='UTC'),
185
+ Timestamp("1908-04-18", tz='UTC'),
186
+ Timestamp("1909-04-10", tz='UTC'),
187
+ Timestamp("1910-03-26", tz='UTC'),
188
+ Timestamp("1911-04-15", tz='UTC'),
189
+ Timestamp("1913-03-22", tz='UTC'),
190
+ Timestamp("1920-04-03", tz='UTC'),
191
+ Timestamp("1929-03-30", tz='UTC'),
192
+ Timestamp("1930-04-19", tz='UTC')
193
+ ]
194
+
195
+ ##################################################
196
+ # US Memorial Day (Decoration Day) May 30
197
+ # Closed every year since 1873
198
+ # Observed on Monday since 1971
199
+ ##################################################
200
+ USMemorialDay = Holiday(
201
+ 'Memorial Day',
202
+ month=5,
203
+ day=25,
204
+ start_date=Timestamp('1971-01-01'),
205
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
206
+ offset=DateOffset(weekday=MO(1)),
207
+ )
208
+ USMemorialDayBefore1952 = Holiday(
209
+ 'Memorial Day',
210
+ month=5,
211
+ day=30,
212
+ end_date=Timestamp('1952-09-28'),
213
+ observance=sunday_to_monday,
214
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY)
215
+ )
216
+ USMemorialDay1952to1964 = Holiday(
217
+ 'Memorial Day',
218
+ month=5,
219
+ day=30,
220
+ start_date=Timestamp('1952-09-29'),
221
+ end_date=Timestamp('1963-12-31'),
222
+ observance=sunday_to_monday,
223
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY)
224
+ )
225
+
226
+ USMemorialDay1964to1969 = Holiday(
227
+ 'Memorial Day',
228
+ month=5,
229
+ day=30,
230
+ start_date=Timestamp('1964-01-01'),
231
+ end_date=Timestamp('1969-12-31'),
232
+ observance=nearest_workday,
233
+ )
234
+
235
+ # Not all Saturdays before/after Decoration Day were observed
236
+ SatBeforeDecorationAdhoc = [
237
+ Timestamp('1904-05-28', tz='UTC'),
238
+ Timestamp('1909-05-29', tz='UTC'),
239
+ Timestamp('1910-05-28', tz='UTC'),
240
+ Timestamp('1921-05-28', tz='UTC'),
241
+ Timestamp('1926-05-29', tz='UTC'),
242
+ Timestamp('1937-05-29', tz='UTC'),
243
+ ]
244
+ SatAfterDecorationAdhoc = [
245
+ Timestamp('1902-05-31', tz='UTC'),
246
+ Timestamp('1913-05-31', tz='UTC'),
247
+ Timestamp('1919-05-31', tz='UTC'),
248
+ Timestamp('1924-05-31', tz='UTC'),
249
+ Timestamp('1930-05-31', tz='UTC'),
250
+ ]
251
+
252
+ DayBeforeDecorationAdhoc = [
253
+ Timestamp('1899-05-29', tz='UTC'),
254
+ Timestamp('1961-05-29', tz='UTC')
255
+ ]
256
+
257
+ #######################################
258
+ # US Juneteenth (June 19th)
259
+ #######################################
260
+ USJuneteenthAfter2022 = Holiday(
261
+ 'Juneteenth Starting at 2022',
262
+ start_date=Timestamp('2022-06-19'),
263
+ month=6, day=19,
264
+ observance=nearest_workday,
265
+ )
266
+
267
+ #######################################
268
+ # US Independence Day July 4
269
+ #######################################
270
+ USIndependenceDay = Holiday(
271
+ 'July 4th',
272
+ month=7,
273
+ day=4,
274
+ start_date=Timestamp('1954-01-01'),
275
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
276
+ observance=nearest_workday,
277
+ )
278
+ USIndependenceDayPre1952 = Holiday(
279
+ 'July 4th',
280
+ month=7,
281
+ day=4,
282
+ end_date=Timestamp('1952-09-28'),
283
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY),
284
+ observance=sunday_to_monday,
285
+ )
286
+ USIndependenceDay1952to1954 = Holiday(
287
+ 'July 4th',
288
+ month=7,
289
+ day=4,
290
+ start_date=Timestamp('1952-09-29'),
291
+ end_date=Timestamp('1953-12-31'),
292
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
293
+ observance=sunday_to_monday,
294
+ )
295
+
296
+ MonTuesThursBeforeIndependenceDay = Holiday(
297
+ # When July 4th is a Tuesday, Wednesday, or Friday, the previous day is a
298
+ # half day.
299
+ 'Mondays, Tuesdays, and Thursdays Before Independence Day',
300
+ month=7,
301
+ day=3,
302
+ days_of_week=(MONDAY, TUESDAY, THURSDAY),
303
+ start_date=Timestamp("1995-01-01"),
304
+ )
305
+
306
+ FridayAfterIndependenceDayNYSEpre2013 = Holiday(
307
+ # When July 4th is a Thursday, the next day is a half day prior to 2013.
308
+ # Since 2013 the early close is on Wednesday and Friday is a full day
309
+ "Fridays after Independence Day prior to 2013",
310
+ month=7,
311
+ day=5,
312
+ days_of_week=(FRIDAY,),
313
+ start_date=Timestamp("1996-01-01"),
314
+ end_date=Timestamp("2012-12-31"),
315
+ )
316
+
317
+ WednesdayBeforeIndependenceDayPost2013 = Holiday(
318
+ # When July 4th is a Thursday, the next day is a half day prior to 2013.
319
+ # Since 2013 the early close is on Wednesday and Friday is a full day
320
+ "Wednesdays Before Independence Day including and after 2013",
321
+ month=7,
322
+ day=3,
323
+ days_of_week=(WEDNESDAY,),
324
+ start_date=Timestamp("2013-01-01"),
325
+ )
326
+
327
+ MonBeforeIndependenceDayAdhoc = [
328
+ Timestamp('1899-07-03', tz='UTC'),
329
+ ]
330
+
331
+ # Not all Saturdays before/after Independence day are observed
332
+ SatBeforeIndependenceDayAdhoc = [
333
+ Timestamp('1887-07-02', tz='UTC'),
334
+ Timestamp('1892-07-02', tz='UTC'),
335
+ Timestamp('1898-07-02', tz='UTC'),
336
+ Timestamp('1904-07-02', tz='UTC'),
337
+ Timestamp('1909-07-03', tz='UTC'),
338
+ Timestamp('1910-07-02', tz='UTC'),
339
+ Timestamp('1920-07-03', tz='UTC'),
340
+ Timestamp('1921-07-02', tz='UTC'),
341
+ Timestamp('1926-07-03', tz='UTC'),
342
+ Timestamp('1932-07-02', tz='UTC'),
343
+ Timestamp('1937-07-03', tz='UTC'),
344
+ ]
345
+
346
+ SatAfterIndependenceDayAdhoc = [
347
+ Timestamp('1890-07-05', tz='UTC'),
348
+ Timestamp('1902-07-05', tz='UTC'),
349
+ Timestamp('1913-07-05', tz='UTC'),
350
+ Timestamp('1919-07-05', tz='UTC'),
351
+ Timestamp('1930-07-05', tz='UTC'),
352
+ ]
353
+
354
+ DaysAfterIndependenceDayAdhoc = [
355
+ Timestamp('1901-07-05', tz='UTC'),
356
+ Timestamp('1901-07-06', tz='UTC'),
357
+ Timestamp('1968-07-05', tz='UTC')
358
+ ]
359
+
360
+ DaysBeforeIndependenceDay1pmEarlyCloseAdhoc = [
361
+ Timestamp('2013-07-03', tz='UTC')
362
+ ]
363
+
364
+ #################################################
365
+ # US Labor Day Starting 1887
366
+ #################################################
367
+ USLaborDayStarting1887 = Holiday(
368
+ "Labor Day",
369
+ month=9,
370
+ day=1,
371
+ start_date=Timestamp("1887-01-01"),
372
+ offset=DateOffset(weekday=MO(1))
373
+ )
374
+
375
+ # Not every Saturday before Labor Day is observed. 1894 is an example.
376
+ SatBeforeLaborDayAdhoc = [
377
+ Timestamp('1888-09-01', tz='UTC'),
378
+ Timestamp('1898-09-03', tz='UTC'),
379
+ Timestamp('1900-09-01', tz='UTC'),
380
+ Timestamp('1901-08-31', tz='UTC'),
381
+ Timestamp('1902-08-30', tz='UTC'),
382
+ Timestamp('1903-09-05', tz='UTC'),
383
+ Timestamp('1904-09-03', tz='UTC'),
384
+ Timestamp('1907-08-31', tz='UTC'),
385
+ Timestamp('1908-09-05', tz='UTC'),
386
+ Timestamp('1909-09-04', tz='UTC'),
387
+ Timestamp('1910-09-03', tz='UTC'),
388
+ Timestamp('1911-09-02', tz='UTC'),
389
+ Timestamp('1912-08-31', tz='UTC'),
390
+ Timestamp('1913-08-30', tz='UTC'),
391
+ Timestamp('1917-09-01', tz='UTC'),
392
+ Timestamp('1919-08-30', tz='UTC'),
393
+ Timestamp('1920-09-04', tz='UTC'),
394
+ Timestamp('1921-09-03', tz='UTC'),
395
+ Timestamp('1926-09-04', tz='UTC'),
396
+ Timestamp('1929-08-31', tz='UTC'),
397
+ Timestamp('1930-08-30', tz='UTC'),
398
+ Timestamp('1931-09-05', tz='UTC'),
399
+ ]
400
+
401
+ ###################################################
402
+ # US Election Day Nov 2
403
+ ###################################################
404
+ USElectionDay1848to1967 = Holiday(
405
+ 'Election Day',
406
+ month=11,
407
+ day=2,
408
+ start_date=Timestamp('1848-1-1'),
409
+ end_date=Timestamp('1967-12-31'),
410
+ offset=DateOffset(weekday=TU(1)),
411
+ )
412
+
413
+ USElectionDay1968to1980Adhoc = [
414
+ Timestamp('1968-11-05', tz="UTC"),
415
+ Timestamp('1972-11-07', tz="UTC"),
416
+ Timestamp('1976-11-02', tz="UTC"),
417
+ Timestamp('1980-11-04', tz="UTC")]
418
+
419
+ ################################################
420
+ # US Thanksgiving Nov 30
421
+ ################################################
422
+ USThanksgivingDay = Holiday(
423
+ 'Thanksgiving',
424
+ start_date=Timestamp('1942-01-01'),
425
+ month=11, day=1,
426
+ offset=DateOffset(weekday=TH(4))
427
+ )
428
+
429
+ USThanksgivingDayBefore1939 = Holiday(
430
+ 'Thanksgiving Before 1939',
431
+ start_date=Timestamp('1864-01-01'),
432
+ end_date=Timestamp('1938-12-31'),
433
+ month=11, day=30,
434
+ offset=DateOffset(weekday=TH(-1))
435
+ )
436
+
437
+ USThanksgivingDay1939to1941 = Holiday(
438
+ 'Thanksgiving 1939 to 1941',
439
+ start_date=Timestamp('1939-01-01'),
440
+ end_date=Timestamp('1941-12-31'),
441
+ month=11, day=30,
442
+ offset=DateOffset(weekday=TH(-2))
443
+ )
444
+
445
+ DayAfterThanksgiving2pmEarlyCloseBefore1993 = Holiday(
446
+ 'Black Friday',
447
+ month=11,
448
+ day=1,
449
+ # Black Friday was not observed until 1992.
450
+ start_date=Timestamp('1992-01-01'),
451
+ end_date=Timestamp('1993-01-01'),
452
+ offset=[DateOffset(weekday=TH(4)), Day(1)],
453
+ )
454
+
455
+ DayAfterThanksgiving1pmEarlyCloseInOrAfter1993 = Holiday(
456
+ 'Black Friday',
457
+ month=11,
458
+ day=1,
459
+ start_date=Timestamp('1993-01-01'),
460
+ offset=[DateOffset(weekday=TH(4)), Day(1)],
461
+ )
462
+
463
+ FridayAfterThanksgivingAdHoc = [
464
+ Timestamp('1888-11-30', tz='UTC'),
465
+ ]
466
+
467
+ ################################
468
+ # Christmas Dec 25
469
+ ################################
470
+ ChristmasNYSE = Holiday(
471
+ 'Christmas',
472
+ month=12,
473
+ day=25,
474
+ start_date=Timestamp('1999-01-01'),
475
+ observance=nearest_workday,
476
+ )
477
+
478
+ Christmas54to98NYSE = Holiday(
479
+ 'Christmas',
480
+ month=12,
481
+ day=25,
482
+ start_date=Timestamp('1954-01-01'),
483
+ end_date=Timestamp('1998-12-31'),
484
+ observance=nearest_workday,
485
+ )
486
+
487
+ ChristmasBefore1954 = Holiday(
488
+ 'Christmas',
489
+ month=12,
490
+ day=25,
491
+ end_date=Timestamp('1953-12-31'),
492
+ observance=sunday_to_monday,
493
+ )
494
+
495
+ # Only some Christmas Eve's were fully close
496
+ ChristmasEvesAdhoc = [
497
+ Timestamp('1900-12-24', tz='UTC'),
498
+ Timestamp('1945-12-24', tz='UTC'),
499
+ Timestamp('1956-12-24', tz='UTC'),
500
+ ]
501
+
502
+ DayAfterChristmasAdhoc = [
503
+ Timestamp('1958-12-26', tz='UTC'),
504
+ ]
505
+
506
+ DayAfterChristmas1pmEarlyCloseAdhoc = [
507
+ Timestamp('1997-12-26', tz='UTC'),
508
+ Timestamp('2003-12-26', tz='UTC'),
509
+ ]
510
+
511
+ ChristmasEvePost1999Early1pmClose = Holiday(
512
+ # When Christmas Eve is Mon-Thu it is a 1pm early close
513
+ 'Mondays, Tuesdays, Wednesdays, and Thursdays Before Christmas',
514
+ month=12,
515
+ day=24,
516
+ days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY),
517
+ start_date=Timestamp("1999-01-01"),
518
+ )
519
+
520
+ ChristmasEve1pmEarlyCloseAdhoc = [
521
+ Timestamp('1951-12-24', tz='UTC'),
522
+ Timestamp('1996-12-24', tz='UTC'),
523
+ Timestamp('1997-12-24', tz='UTC'),
524
+ Timestamp('1998-12-24', tz='UTC'),
525
+ Timestamp('1999-12-24', tz='UTC'),
526
+ ]
527
+
528
+ # Only some Christmas Eve's were 2pm early close (1976-1979 were not)
529
+ ChristmasEve2pmEarlyCloseAdhoc = [
530
+ Timestamp('1974-12-24', tz='UTC'),
531
+ Timestamp('1975-12-24', tz='UTC'),
532
+ Timestamp('1990-12-24', tz='UTC'), #### This one was also in the 1pm list, in the tests you check for 2pm
533
+ Timestamp('1991-12-24', tz='UTC'),
534
+ Timestamp('1992-12-24', tz='UTC'),
535
+ ]
536
+
537
+ # Not every Saturday before/after Christmas is a holiday
538
+ SatBeforeChristmasAdhoc = [
539
+ Timestamp('1887-12-24', tz='UTC'),
540
+ Timestamp('1898-12-24', tz='UTC'),
541
+ Timestamp('1904-12-24', tz='UTC'),
542
+ Timestamp('1910-12-24', tz='UTC'),
543
+ Timestamp('1911-12-23', tz='UTC'),
544
+ Timestamp('1922-12-23', tz='UTC'),
545
+ Timestamp('1949-12-24', tz='UTC'),
546
+ Timestamp('1950-12-23', tz='UTC'),
547
+ ]
548
+
549
+ SatAfterChristmasAdhoc = [
550
+ Timestamp('1891-12-26', tz='UTC'),
551
+ Timestamp('1896-12-26', tz='UTC'),
552
+ Timestamp('1903-12-26', tz='UTC'),
553
+ Timestamp('1908-12-26', tz='UTC'),
554
+ Timestamp('1925-12-26', tz='UTC'),
555
+ Timestamp('1931-12-26', tz='UTC'),
556
+ Timestamp('1936-12-26', tz='UTC'),
557
+ ]
558
+
559
+
560
+ #####################################
561
+ # Retired holidays
562
+ #####################################
563
+ # Armistice/Veterans day
564
+ USVeteransDay1934to1953 = Holiday(
565
+ 'Veteran Day',
566
+ month=11,
567
+ day=11,
568
+ start_date=Timestamp('1934-1-1'),
569
+ end_date=Timestamp('1953-12-31'),
570
+ observance=sunday_to_monday,
571
+ )
572
+
573
+ USVetransDayAdHoc = [
574
+ Timestamp("1921-11-11", tz="UTC"),
575
+ Timestamp("1968-11-11", tz="UTC")
576
+ ]
577
+
578
+ USColumbusDayBefore1954 = Holiday(
579
+ 'Columbus Day',
580
+ month=10,
581
+ day=12,
582
+ start_date=Timestamp('1909-01-01'),
583
+ end_date=Timestamp('1953-12-31'),
584
+ observance=sunday_to_monday,
585
+ )
586
+
587
+ SatAfterColumbusDayAdHoc = [
588
+ Timestamp("1917-10-13", tz="UTC"),
589
+ Timestamp("1945-10-13", tz="UTC"),
590
+ ]
591
+
592
+
593
+ ##########################
594
+ # Non-recurring holidays
595
+ ##########################
596
+
597
+ # 1885
598
+ UlyssesGrantFuneral1885 = [Timestamp('1885-08-08', tz='UTC')]
599
+
600
+ # 1888
601
+ GreatBlizzardOf1888 = [
602
+ Timestamp('1888-03-12', tz='UTC'),
603
+ Timestamp('1888-03-13', tz='UTC'),
604
+ ]
605
+
606
+ # 1889
607
+ WashingtonInaugurationCentennialCelebration1889 = [
608
+ Timestamp("1889-04-29", tz='UTC'),
609
+ Timestamp("1889-04-30", tz='UTC'),
610
+ Timestamp("1889-05-01", tz='UTC'),
611
+ ]
612
+
613
+
614
+ # 1892
615
+ ColumbianCelebration1892 = [
616
+ Timestamp("1892-10-12", tz='UTC'),
617
+ Timestamp("1892-10-21", tz='UTC'),
618
+ Timestamp("1892-10-22", tz='UTC'),
619
+ Timestamp("1893-04-27", tz='UTC'),
620
+ ]
621
+
622
+ # 1898
623
+ # NYC's 5 boroughs founded as NYC
624
+ # Not actually celebrated due to Spanish-American war but market was closed
625
+ CharterDay1898 = [Timestamp('1898-05-04', tz='UTC')]
626
+
627
+ WelcomeNavalCommander1898 = [Timestamp('1898-08-20', tz='UTC')]
628
+
629
+ # 1899
630
+ AdmiralDeweyCelebration1899 = [Timestamp('1899-09-29', tz='UTC'),
631
+ Timestamp('1899-09-30', tz='UTC')
632
+ ]
633
+
634
+ GarretHobartFuneral1899 = [Timestamp('1899-11-25', tz='UTC')]
635
+
636
+ # 1901
637
+ QueenVictoriaFuneral1901 = [Timestamp('1901-02-02', tz='UTC')]
638
+
639
+ MovedToProduceExchange1901 = [Timestamp('1901-04-27', tz='UTC')]
640
+
641
+ EnlargedProduceExchange1901 = [Timestamp('1901-05-11', tz='UTC')]
642
+
643
+ McKinleyDeathAndFuneral1901 = [Timestamp('1901-09-14', tz='UTC'),
644
+ Timestamp('1901-09-19', tz='UTC'),]
645
+
646
+ # 1902
647
+ KingEdwardVIIcoronation1902 = [Timestamp('1902-08-09', tz='UTC')]
648
+
649
+ # 1903
650
+ NYSEnewBuildingOpen1903 = [Timestamp('1903-04-22', tz='UTC')]
651
+
652
+ # 1908
653
+ GroverClevelandFuneral1pmClose1908 = Holiday(
654
+ 'Funeral of Grover Cleveland 1908 1pm Close',
655
+ month=6,
656
+ day=26,
657
+ start_date=Timestamp('1908-06-26'),
658
+ end_date=Timestamp('1908-06-26'),
659
+ )
660
+
661
+ # 1909
662
+ # 300th anniversary of Hudson discovering the Hudson river and
663
+ # 100th anniversary of Fulton inventing the paddle steamer
664
+ HudsonFultonCelebration1909 = [Timestamp('1909-09-25', tz='UTC')]
665
+
666
+ # 1910
667
+ KingEdwardDeath11amyClose1910 = Holiday(
668
+ 'King Edward VII Death May 7, 1910',
669
+ month=5,
670
+ day=7,
671
+ start_date=Timestamp('1910-05-07'),
672
+ end_date=Timestamp('1910-05-07'),
673
+ )
674
+
675
+ KingEdwardFuneral12pmOpen1910 = Holiday(
676
+ 'King Edward VII Funeral 12pm late open May 20, 1910',
677
+ month=5,
678
+ day=20,
679
+ start_date=Timestamp('1910-05-20'),
680
+ end_date=Timestamp('1910-05-20'),
681
+ )
682
+
683
+ # 1912
684
+ JamesShermanFuneral1912 = [Timestamp('1912-11-02', tz='UTC')]
685
+
686
+ # 1913
687
+ JPMorganFuneral12pmOpen1913 = Holiday(
688
+ 'JP Morgan Funeral 12pm late open April 14, 1913',
689
+ month=4,
690
+ day=14,
691
+ start_date=Timestamp('1913-04-14'),
692
+ end_date=Timestamp('1913-04-14'),
693
+ )
694
+
695
+ WilliamGaynorFuneral12pmOpen1913 = Holiday(
696
+ 'Mayor William J. Gaynor Funeral 12pm late open Sept 22, 1913',
697
+ month=9,
698
+ day=22,
699
+ start_date=Timestamp('1913-09-22'),
700
+ end_date=Timestamp('1913-09-22'),
701
+ )
702
+
703
+ # 1914
704
+
705
+ # Reopened for trading bonds (with restrictions) Nov 27, 1914
706
+ # Reopened for trading stocks (with restrictions) Dec 12, 1914
707
+ # Restrictions remained in place until April 1, 1915
708
+ OnsetOfWWI1914 = date_range('1914-07-31',
709
+ '1914-12-11',
710
+ freq=CustomBusinessDay(weekmask = 'Mon Tue Wed Thu Fri Sat'),
711
+ tz='UTC'
712
+ )
713
+
714
+ # 1917
715
+ DraftRegistrationDay1917 = [Timestamp('1917-06-05', tz='UTC')]
716
+
717
+ WeatherHeatClosing1917 = [Timestamp('1917-08-04', tz='UTC')]
718
+
719
+ ParadeOfNationalGuardEarlyClose1917 = Holiday(
720
+ 'Parade of National Guard 12pm Early Close Aug 29, 1917',
721
+ month=8,
722
+ day=29,
723
+ start_date=Timestamp('1917-08-29'),
724
+ end_date=Timestamp('1917-08-29'),
725
+ )
726
+
727
+ LibertyDay12pmEarlyClose1917 = Holiday(
728
+ 'Liberty Day 12pm Early Close Oct 24, 1917',
729
+ month=10,
730
+ day=24,
731
+ start_date=Timestamp('1917-10-24'),
732
+ end_date=Timestamp('1917-10-24'),
733
+ )
734
+
735
+ # 1918
736
+ WeatherNoHeatClosing1918 = [
737
+ Timestamp('1918-01-28', tz='UTC'),
738
+ Timestamp('1918-02-04', tz='UTC'),
739
+ Timestamp('1918-02-11', tz='UTC'),
740
+
741
+ ]
742
+
743
+ LibertyDay12pmEarlyClose1918 = Holiday(
744
+ 'Liberty Day 12pm Early Close April 26, 1918',
745
+ month=4,
746
+ day=26,
747
+ start_date=Timestamp('1918-04-26'),
748
+ end_date=Timestamp('1918-04-26'),
749
+ )
750
+
751
+ DraftRegistrationDay1918 = [Timestamp('1918-09-12', tz='UTC')]
752
+
753
+ FalseArmisticeReport1430EarlyClose1918 = Holiday(
754
+ 'False Armistice Report 2:30pm Early Close Nov 7, 1918',
755
+ month=11,
756
+ day=7,
757
+ start_date=Timestamp('1918-11-07'),
758
+ end_date=Timestamp('1918-11-07'),
759
+ )
760
+ ArmisticeSigned1918 = [Timestamp('1918-11-11', tz='UTC')]
761
+
762
+ # 1919
763
+ RooseveltFuneral1230EarlyClose1919 = Holiday(
764
+ 'Former President Roosevelt funeral 12:30pm Early Close Jan 7, 1919',
765
+ month=1,
766
+ day=7,
767
+ start_date=Timestamp('1919-01-07'),
768
+ end_date=Timestamp('1919-01-07'),
769
+ )
770
+
771
+ Homecoming27Division1919 = [Timestamp('1919-03-25', tz='UTC')]
772
+
773
+ ParadeOf77thDivision1919 = [Timestamp('1919-05-06', tz='UTC')]
774
+
775
+ BacklogRelief1919 = [
776
+ Timestamp('1919-07-19', tz='UTC'),
777
+ Timestamp('1919-08-02', tz='UTC'),
778
+ Timestamp('1919-08-16', tz='UTC'),
779
+ ]
780
+
781
+ GeneralPershingReturn1919 = [Timestamp('1919-09-10', tz='UTC')]
782
+
783
+ TrafficBlockLateOpen1919 = Holiday(
784
+ 'Traffic Block 10:30am late open Dec. 30, 1919',
785
+ month=12,
786
+ day=30,
787
+ start_date=Timestamp('1919-12-30'),
788
+ end_date=Timestamp('1919-12-30'),
789
+ )
790
+
791
+ # 1920
792
+ TrafficBlockLateOpen1920 = Holiday(
793
+ 'Traffic Block 10:30am late open Feb. 6, 1920',
794
+ month=2,
795
+ day=6,
796
+ start_date=Timestamp('1920-02-06'),
797
+ end_date=Timestamp('1920-02-06'),
798
+ )
799
+
800
+ OfficeLocationChange1920 = [Timestamp('1920-05-01', tz='UTC')]
801
+
802
+ WallStreetExplosionEarlyClose1920 = Holiday(
803
+ 'Wall Street Explosion 12:00 Early Close Sept 16, 1920',
804
+ month=9,
805
+ day=16,
806
+ start_date=Timestamp('1920-09-16'),
807
+ end_date=Timestamp('1920-09-16'),
808
+ )
809
+
810
+ # 1921
811
+ AnnunciatorBoardFire1pmLateOpen1921 = Holiday(
812
+ 'Annunciator Board Fire 1pm late open Aug 8, 1921',
813
+ month=8,
814
+ day=2,
815
+ start_date=Timestamp('1921-08-02'),
816
+ end_date=Timestamp('1921-08-02'),
817
+ )
818
+
819
+ # 1923
820
+ HardingDeath1923 = [Timestamp('1923-08-03', tz='UTC')]
821
+
822
+ HardingFuneral1923 = [Timestamp('1923-08-10', tz='UTC')]
823
+
824
+ # 1924
825
+ WoodrowWilsonFuneral1230EarlyClose1924 = Holiday(
826
+ 'Former President Woodrow Wilson Funeral 12:30 Early Close Feb 6, 1924',
827
+ month=2,
828
+ day=6,
829
+ start_date=Timestamp('1924-02-06'),
830
+ end_date=Timestamp('1924-02-06'),
831
+ )
832
+
833
+ # 1925
834
+ EclipseOfSunLateOpen1925 = Holiday(
835
+ 'Eclipse of Sun 10:45am late open Jan 25, 1925',
836
+ month=1,
837
+ day=24,
838
+ start_date=Timestamp('1925-01-24'),
839
+ end_date=Timestamp('1925-01-24'),
840
+ )
841
+
842
+ CromwellFuneral1430EarlyClose1925 = Holiday(
843
+ 'Former NYSE President Seymour L. Cromwell Funeral 2:30pm Early Close Sept 18, 1925',
844
+ month=9,
845
+ day=18,
846
+ start_date=Timestamp('1925-09-18'),
847
+ end_date=Timestamp('1925-09-18'),
848
+ )
849
+
850
+ # 1927
851
+ LindberghParade1927 = [Timestamp('1927-06-13', tz='UTC')]
852
+
853
+ # 1928
854
+ BacklogRelief1928 = [
855
+ Timestamp('1928-04-07', tz='UTC'),
856
+ Timestamp('1928-04-21', tz='UTC'),
857
+ Timestamp('1928-05-05', tz='UTC'),
858
+ Timestamp('1928-05-12', tz='UTC'),
859
+ Timestamp('1928-05-19', tz='UTC'),
860
+ Timestamp('1928-05-26', tz='UTC'),
861
+ Timestamp('1928-11-24', tz='UTC'),
862
+ ]
863
+
864
+ BacklogRelief2pmEarlyClose1928 = date_range('1928-05-21',
865
+ '1928-05-25',
866
+ freq=CustomBusinessDay(weekmask = 'Mon Tue Wed Thu Fri Sat'),
867
+ tz='UTC'
868
+ )
869
+
870
+ # 1929
871
+ BacklogRelief1929 = [
872
+ Timestamp('1929-02-09', tz='UTC'),
873
+ Timestamp('1929-11-01', tz='UTC'),
874
+ Timestamp('1929-11-02', tz='UTC'),
875
+ Timestamp('1929-11-09', tz='UTC'),
876
+ Timestamp('1929-11-16', tz='UTC'),
877
+ Timestamp('1929-11-23', tz='UTC'),
878
+ Timestamp('1929-11-29', tz='UTC'),
879
+ Timestamp('1929-11-30', tz='UTC'),
880
+ ]
881
+
882
+ BacklogRelief1pmEarlyClose1929 = [
883
+ Timestamp('1929-11-06', tz='UTC'),
884
+ Timestamp('1929-11-07', tz='UTC'),
885
+ Timestamp('1929-11-08', tz='UTC'),
886
+ Timestamp('1929-11-11', tz='UTC'),
887
+ Timestamp('1929-11-12', tz='UTC'),
888
+ Timestamp('1929-11-13', tz='UTC'),
889
+ Timestamp('1929-11-14', tz='UTC'),
890
+ Timestamp('1929-11-15', tz='UTC'),
891
+ Timestamp('1929-11-18', tz='UTC'),
892
+ Timestamp('1929-11-19', tz='UTC'),
893
+ Timestamp('1929-11-20', tz='UTC'),
894
+ Timestamp('1929-11-21', tz='UTC'),
895
+ Timestamp('1929-11-22', tz='UTC')
896
+ ]
897
+
898
+ BacklogRelief12pmLateOpen1929 = [
899
+ Timestamp('1929-10-31', tz='UTC'),
900
+ ]
901
+
902
+ # 1930
903
+ TaftFuneral1230EarlyClose1930 = Holiday(
904
+ 'Former President William Howard Taft Funeral 12:30pm Early Close Mar 11, 1930',
905
+ month=3,
906
+ day=11,
907
+ start_date=Timestamp('1930-03-11'),
908
+ end_date=Timestamp('1930-03-11'),
909
+ )
910
+
911
+ # 1933
912
+ CoolidgeFuneral1933 = [Timestamp('1933-01-07', tz='UTC'),]
913
+
914
+ BankHolidays1933 = [
915
+ Timestamp('1933-03-04', tz='UTC'),
916
+ Timestamp('1933-03-06', tz='UTC'),
917
+ Timestamp('1933-03-07', tz='UTC'),
918
+ Timestamp('1933-03-08', tz='UTC'),
919
+ Timestamp('1933-03-09', tz='UTC'),
920
+ Timestamp('1933-03-10', tz='UTC'),
921
+ Timestamp('1933-03-11', tz='UTC'),
922
+ Timestamp('1933-03-12', tz='UTC'),
923
+ Timestamp('1933-03-13', tz='UTC'),
924
+ Timestamp('1933-03-14', tz='UTC'),
925
+ ]
926
+
927
+ GasFumesOnTradingFloor1230EarlyClose1933 = Holiday(
928
+ 'Gas Fumes on Trading Floor 12:30pm Early Close Aug 4, 1933',
929
+ month=8,
930
+ day=4,
931
+ start_date=Timestamp('1933-08-04'),
932
+ end_date=Timestamp('1933-08-04'),
933
+ )
934
+
935
+
936
+ HeavyVolume1933 = [
937
+ Timestamp('1933-07-29', tz='UTC'),
938
+ Timestamp('1933-08-05', tz='UTC'),
939
+ Timestamp('1933-08-12', tz='UTC'),
940
+ Timestamp('1933-08-19', tz='UTC'),
941
+ Timestamp('1933-08-26', tz='UTC'),
942
+ Timestamp('1933-09-02', tz='UTC'),
943
+ ]
944
+
945
+
946
+ HeavyVolume12pmLateOpen1933 = [
947
+ Timestamp('1933-07-24', tz='UTC'),
948
+ Timestamp('1933-07-25', tz='UTC'),
949
+ ]
950
+
951
+ HeavyVolume11amLateOpen1933 = [
952
+ Timestamp('1933-07-26', tz='UTC'),
953
+ Timestamp('1933-07-27', tz='UTC'),
954
+ Timestamp('1933-07-28', tz='UTC'),
955
+ ]
956
+
957
+ HeavyVolume2pmEarlyClose1933 = [
958
+ Timestamp('1933-07-26', tz='UTC'),
959
+ Timestamp('1933-07-27', tz='UTC'),
960
+ Timestamp('1933-07-28', tz='UTC'),
961
+ ]
962
+
963
+ NRAdemonstration12pmEarlyClose1933 = Holiday(
964
+ 'NRA Demonstration 12:00 noon Early Close Sept 13, 1933',
965
+ month=9,
966
+ day=13,
967
+ start_date=Timestamp('1933-09-13'),
968
+ end_date=Timestamp('1933-09-13'),
969
+ )
970
+
971
+ # 1934
972
+ Snow11amLateOpen1934 = Holiday(
973
+ 'Severe Snowstorm 11:00am late open Feb 20, 1934',
974
+ month=2,
975
+ day=20,
976
+ start_date=Timestamp('1934-02-20'),
977
+ end_date=Timestamp('1934-02-20'),
978
+ )
979
+
980
+ # 1936
981
+ KingGeorgeVFuneral11amLateOpen1936 = Holiday(
982
+ 'King George V of England 11:00am late open Jan 28, 1936',
983
+ month=1,
984
+ day=28,
985
+ start_date=Timestamp('1936-01-28'),
986
+ end_date=Timestamp('1936-01-28'),
987
+ )
988
+
989
+ # 1944
990
+ SatClosings1944 = [
991
+ Timestamp('1944-08-19', tz='UTC'),
992
+ Timestamp('1944-08-26', tz='UTC'),
993
+ Timestamp('1944-09-02', tz='UTC'),
994
+ ]
995
+
996
+ # 1945
997
+ RooseveltDayOfMourning1945 = [Timestamp('1945-04-14', tz='UTC'),]
998
+
999
+ # Starting in 1945, no Saturday trading over the summer
1000
+ SatClosings1945 = date_range('1945-07-07',
1001
+ '1945-09-01',
1002
+ freq='W-SAT',
1003
+ tz='UTC')
1004
+
1005
+ VJday1945 = [
1006
+ Timestamp('1945-08-15', tz='UTC'),
1007
+ Timestamp('1945-08-16', tz='UTC'),
1008
+ ]
1009
+
1010
+ NavyDay1945 = [
1011
+ Timestamp('1945-10-27', tz='UTC'),
1012
+ ]
1013
+
1014
+ RailroadStrike1946 = [
1015
+ Timestamp('1946-05-25', tz='UTC'),
1016
+ ]
1017
+
1018
+ # 1946
1019
+ SatClosings1946 = date_range('1946-06-01',
1020
+ '1946-09-28',
1021
+ freq='W-SAT',
1022
+ tz='UTC'
1023
+ )
1024
+
1025
+ # 1947
1026
+ SatClosings1947 = date_range('1947-05-31',
1027
+ '1947-09-27',
1028
+ freq='W-SAT',
1029
+ tz='UTC'
1030
+ )
1031
+
1032
+ # 1948
1033
+ SevereWeather1948 = [
1034
+ Timestamp('1948-01-03', tz='UTC'),
1035
+ ]
1036
+
1037
+ SatClosings1948 = date_range('1948-05-29',
1038
+ '1948-09-25',
1039
+ freq='W-SAT',
1040
+ tz='UTC'
1041
+ )
1042
+
1043
+ # 1949
1044
+ SatClosings1949 = date_range('1949-05-28',
1045
+ '1949-09-24',
1046
+ freq='W-SAT',
1047
+ tz='UTC'
1048
+ )
1049
+
1050
+ # 1950
1051
+ SatClosings1950 = date_range('1950-06-03',
1052
+ '1950-09-30',
1053
+ freq='W-SAT',
1054
+ tz='UTC'
1055
+ )
1056
+
1057
+ # 1951
1058
+ SatClosings1951 = date_range('1951-06-02',
1059
+ '1951-09-29',
1060
+ freq='W-SAT',
1061
+ tz='UTC'
1062
+ )
1063
+
1064
+ # 1952
1065
+ SatClosings1952 = date_range('1952-05-31',
1066
+ '1952-09-27',
1067
+ freq='W-SAT',
1068
+ tz='UTC'
1069
+ )
1070
+
1071
+ # 1960
1072
+ Snow11amLateOpening1960 = Holiday(
1073
+ 'Severe Snow 11am Late Opening on Dec 12, 1960',
1074
+ month=12,
1075
+ day=12,
1076
+ start_date=Timestamp('1960-12-12'),
1077
+ end_date=Timestamp('1960-12-12'),
1078
+ )
1079
+
1080
+ # 1963
1081
+ KennedyAssassination1407EarlyClose = Holiday(
1082
+ 'President John F. Kennedy Assassination',
1083
+ month=11,
1084
+ day=22,
1085
+ start_date=Timestamp('1963-11-22'),
1086
+ end_date=Timestamp('1963-11-22'),
1087
+ )
1088
+
1089
+ KennedyFuneral1963 = [Timestamp('1963-11-25', tz='UTC')]
1090
+
1091
+ # 1964
1092
+ HooverFuneral1400EarlyClose1964 = Holiday(
1093
+ 'Former President Herbert C. Hoover Funeral',
1094
+ month=10,
1095
+ day=23,
1096
+ start_date=Timestamp('1964-10-23'),
1097
+ end_date=Timestamp('1964-10-23'),
1098
+ )
1099
+
1100
+ # 1965
1101
+ PowerFail1105LateOpen = Holiday(
1102
+ 'Power Failure in NY grid supply',
1103
+ month=11,
1104
+ day=10,
1105
+ start_date=Timestamp('1965-11-10'),
1106
+ end_date=Timestamp('1965-11-10'),
1107
+ )
1108
+
1109
+ # 1966
1110
+ TransitStrike2pmEarlyClose1966 = date_range('1966-01-06', '1966-01-14',
1111
+ freq=CustomBusinessDay(weekmask = 'Mon Tue Wed Thu Fri'),
1112
+ tz='UTC')
1113
+
1114
+ # 1967
1115
+ Snow1015LateOpen1967 = Holiday(
1116
+ 'Late Open due to snow',
1117
+ month=2,
1118
+ day=7,
1119
+ start_date=Timestamp('1967-02-07'),
1120
+ end_date=Timestamp('1967-02-07'),
1121
+ )
1122
+ Snow2pmEarlyClose1967 = Holiday(
1123
+ 'Late Open due to snow',
1124
+ month=2,
1125
+ day=7,
1126
+ start_date=Timestamp('1967-02-07'),
1127
+ end_date=Timestamp('1967-02-07'),
1128
+ )
1129
+ Backlog2pmEarlyCloses1967 = date_range('1967-08-09', '1967-08-18',
1130
+ freq=CustomBusinessDay(weekmask = 'Mon Tue Wed Thu Fri'),
1131
+ tz='UTC')
1132
+
1133
+ # 1968
1134
+ Backlog2pmEarlyCloses1968 = date_range('1968-01-22', '1968-03-01',
1135
+ freq=CustomBusinessDay(weekmask = 'Mon Tue Wed Thu Fri'),
1136
+ tz='UTC')
1137
+
1138
+
1139
+ MLKdayOfMourning1968 = [Timestamp('1968-04-09', tz='UTC'),]
1140
+
1141
+
1142
+ PaperworkCrisis1968 = [Timestamp('1968-06-12', tz='UTC'),
1143
+ Timestamp('1968-06-19', tz='UTC'),
1144
+ Timestamp('1968-06-26', tz='UTC'),
1145
+ Timestamp('1968-07-10', tz='UTC'),
1146
+ Timestamp('1968-07-17', tz='UTC'),
1147
+ Timestamp('1968-07-24', tz='UTC'),
1148
+ Timestamp('1968-07-31', tz='UTC'),
1149
+ Timestamp('1968-08-07', tz='UTC'),
1150
+ Timestamp('1968-08-14', tz='UTC'),
1151
+ Timestamp('1968-08-21', tz='UTC'),
1152
+ Timestamp('1968-08-28', tz='UTC'),
1153
+ Timestamp('1968-09-11', tz='UTC'),
1154
+ Timestamp('1968-09-18', tz='UTC'),
1155
+ Timestamp('1968-09-25', tz='UTC'),
1156
+ Timestamp('1968-10-02', tz='UTC'),
1157
+ Timestamp('1968-10-09', tz='UTC'),
1158
+ Timestamp('1968-10-16', tz='UTC'),
1159
+ Timestamp('1968-10-23', tz='UTC'),
1160
+ Timestamp('1968-10-30', tz='UTC'),
1161
+ Timestamp('1968-11-20', tz='UTC'),
1162
+ Timestamp('1968-12-04', tz='UTC'),
1163
+ Timestamp('1968-12-11', tz='UTC'),
1164
+ Timestamp('1968-12-18', tz='UTC'),]
1165
+
1166
+
1167
+ # 1969
1168
+ PaperworkCrisis2pmEarlyCloses1969 = date_range('1969-01-01', '1969-07-03',
1169
+ freq=CustomBusinessDay(weekmask = 'Mon Tue Wed Thu Fri'),
1170
+ tz='UTC')
1171
+
1172
+ SnowClosing1969 = [Timestamp('1969-02-10', tz='UTC')]
1173
+
1174
+ Snow11amLateOpen1969 = Holiday(
1175
+ 'Late Open due to snow',
1176
+ month=2,
1177
+ day=11,
1178
+ start_date=Timestamp('1969-02-11'),
1179
+ end_date=Timestamp('1969-02-11'),
1180
+ )
1181
+
1182
+ EisenhowerFuneral1969 = [Timestamp('1969-03-31', tz='UTC'),]
1183
+
1184
+ Storm1045LateOpen1969 = Holiday(
1185
+ 'Late Open due to storm',
1186
+ month=6,
1187
+ day=2,
1188
+ start_date=Timestamp('1969-06-02'),
1189
+ end_date=Timestamp('1969-06-02'),
1190
+ )
1191
+
1192
+ PaperworkCrisis230pmEarlyCloses1969 = date_range('1969-07-07', '1969-09-26',
1193
+ freq=CustomBusinessDay(weekmask = 'Mon Tue Wed Thu Fri'),
1194
+ tz='UTC')
1195
+
1196
+ FirstLunarLandingClosing1969 = [Timestamp('1969-07-21', tz='UTC')]
1197
+
1198
+ PaperworkCrisis3pmEarlyCloses1969to1970 = date_range('1969-09-29', '1970-05-01',
1199
+ freq=CustomBusinessDay(weekmask = 'Mon Tue Wed Thu Fri'),
1200
+ tz='UTC')
1201
+
1202
+ # 1972
1203
+ TrumanFuneral1972 = [Timestamp('1972-12-28', tz='UTC'),]
1204
+
1205
+ # 1973
1206
+ JohnsonFuneral1973 = [Timestamp('1973-01-25', tz='UTC'),]
1207
+
1208
+ Ice11amLateOpen1973 = Holiday(
1209
+ 'Late Open due to storm',
1210
+ month=12,
1211
+ day=17,
1212
+ start_date=Timestamp('1973-12-17'),
1213
+ end_date=Timestamp('1973-12-17'),
1214
+ )
1215
+
1216
+ # 1974
1217
+ MerrillLynchComputer1015LateOpen1974 = Holiday(
1218
+ 'Late Open due to Merrill Lynch Computer trouble',
1219
+ month=1,
1220
+ day=16,
1221
+ start_date=Timestamp('1974-01-16'),
1222
+ end_date=Timestamp('1974-01-16'),
1223
+ )
1224
+ FireDrill1015LateOpen1974 = Holiday(
1225
+ 'Late Open due to Merrill Lynch Computer trouble',
1226
+ month=11,
1227
+ day=22,
1228
+ start_date=Timestamp('1974-11-22'),
1229
+ end_date=Timestamp('1974-11-22'),
1230
+ )
1231
+
1232
+ # 1975
1233
+ Snow230EarlyClose1975 = Holiday(
1234
+ 'Early Close at 2:30pm due to snow',
1235
+ month=2,
1236
+ day=12,
1237
+ start_date=Timestamp('1975-02-12'),
1238
+ end_date=Timestamp('1975-02-12'),
1239
+ )
1240
+
1241
+ # 1976
1242
+ Storm1115LateOpen1976 = Holiday(
1243
+ 'Late Open 11:15am due to storm',
1244
+ month=2,
1245
+ day=2,
1246
+ start_date=Timestamp('1976-02-02'),
1247
+ end_date=Timestamp('1976-02-02'),
1248
+ )
1249
+
1250
+ FireDrill1015LateOpen1976 = Holiday(
1251
+ 'Late Open 10:15am due to fire drill',
1252
+ month=6,
1253
+ day=8,
1254
+ start_date=Timestamp('1976-06-08'),
1255
+ end_date=Timestamp('1976-06-08'),
1256
+ )
1257
+
1258
+ HurricaneWatch3pmEarlyClose1976 = Holiday(
1259
+ 'Early Close 3pm for Hurricane Watch',
1260
+ month=8,
1261
+ day=9,
1262
+ start_date=Timestamp('1976-08-09'),
1263
+ end_date=Timestamp('1976-08-09'),
1264
+ )
1265
+
1266
+ # 1977
1267
+ NewYorkCityBlackout77 = [Timestamp('1977-07-14', tz='UTC')]
1268
+
1269
+ # 1978
1270
+ Snow12pmLateOpen1978 = Holiday(
1271
+ 'Late Open due to snow',
1272
+ month=1,
1273
+ day=20,
1274
+ start_date=Timestamp('1978-01-20'),
1275
+ end_date=Timestamp('1978-01-20'),
1276
+ )
1277
+
1278
+ Snow2pmEarlyClose1978 = Holiday(
1279
+ 'Early close due to snow',
1280
+ month=2,
1281
+ day=6,
1282
+ start_date=Timestamp('1978-02-06'),
1283
+ end_date=Timestamp('1978-02-06'),
1284
+ )
1285
+
1286
+ Snow11amLateOpen1978 = Holiday(
1287
+ 'Late Open due to snow',
1288
+ month=2,
1289
+ day=7,
1290
+ start_date=Timestamp('1978-02-07'),
1291
+ end_date=Timestamp('1978-02-07'),
1292
+ )
1293
+
1294
+ # 1981
1295
+ ReaganAssassAttempt317pmEarlyClose1981 = Holiday(
1296
+ 'President Reagan Assassination Attempt',
1297
+ month=3,
1298
+ day=30,
1299
+ start_date=Timestamp('1981-03-30'),
1300
+ end_date=Timestamp('1981-03-30'),
1301
+ )
1302
+
1303
+ ConEdPowerFail328pmEarlyClose1981 = Holiday(
1304
+ 'Con Edison power failure',
1305
+ month=9,
1306
+ day=9,
1307
+ start_date=Timestamp('1981-09-09'),
1308
+ end_date=Timestamp('1981-09-09'),
1309
+ )
1310
+
1311
+ # http://en.wikipedia.org/wiki/Hurricane_Gloria
1312
+ HurricaneGloriaClosings1985= [Timestamp('1985-09-27', tz='UTC')]
1313
+
1314
+
1315
+ # 1987
1316
+ Backlog2pmEarlyCloses1987 = date_range('1987-10-23', '1987-10-30', tz='UTC')
1317
+ Backlog230pmEarlyCloses1987 = date_range('1987-11-02', '1987-11-04', tz='UTC')
1318
+ Backlog3pmEarlyCloses1987 = date_range('1987-11-05', '1987-11-06', tz='UTC')
1319
+ Backlog330pmEarlyCloses1987 = date_range('1987-11-09', '1987-11-11', tz='UTC')
1320
+
1321
+ # 1989
1322
+ Fire11amLateOpen1989 = Holiday(
1323
+ 'Electrical Fire',
1324
+ month=11,
1325
+ day=10,
1326
+ start_date=Timestamp('1989-11-10'),
1327
+ end_date=Timestamp('1989-11-10'),
1328
+ )
1329
+
1330
+ # 1990
1331
+
1332
+ ConEdXformer931amLateOpen1990 = Holiday(
1333
+ 'Con Edison transformer explosion',
1334
+ month=12,
1335
+ day=27,
1336
+ start_date=Timestamp('1990-12-27'),
1337
+ end_date=Timestamp('1990-12-27'),
1338
+ )
1339
+
1340
+ # 1991
1341
+ TroopsInGulf931LateOpens1991 = [
1342
+ Timestamp("1991-01-17", tz='UTC'),
1343
+ Timestamp("1991-02-25", tz='UTC')
1344
+ ]
1345
+
1346
+ # 1994
1347
+ Snow230pmEarlyClose1994 = Holiday(
1348
+ 'Snowstorm',
1349
+ month=2,
1350
+ day=11,
1351
+ start_date=Timestamp('1994-02-11'),
1352
+ end_date=Timestamp('1994-02-11'),
1353
+ )
1354
+
1355
+ NixonFuneral1994 = [Timestamp('1994-04-27', tz='UTC'),]
1356
+
1357
+ # 1995
1358
+ Computer1030LateOpen1995 = Holiday(
1359
+ 'Computer Systems Troubles',
1360
+ month=12,
1361
+ day=18,
1362
+ start_date=Timestamp('1995-12-18'),
1363
+ end_date=Timestamp('1995-12-18'),
1364
+ )
1365
+
1366
+ # 1996
1367
+ Snow11amLateOpen1996 = Holiday(
1368
+ 'Snow',
1369
+ month=1,
1370
+ day=8,
1371
+ start_date=Timestamp('1996-01-08'),
1372
+ end_date=Timestamp('1996-01-08'),
1373
+ )
1374
+
1375
+ Snow2pmEarlyClose1996 = Holiday(
1376
+ 'Snow',
1377
+ month=1,
1378
+ day=8,
1379
+ start_date=Timestamp('1996-01-08'),
1380
+ end_date=Timestamp('1996-01-08'),
1381
+ )
1382
+
1383
+ CircuitBreakerTriggered330pmEarlyClose1997 = Holiday(
1384
+ 'Oct 27 1997 Stock Market Drop Circuit Breaker Triggered',
1385
+ month=10,
1386
+ day=27,
1387
+ start_date=Timestamp('1997-10-27'),
1388
+ end_date=Timestamp('1997-10-27'),
1389
+ )
1390
+
1391
+ # 2001
1392
+ # http://en.wikipedia.org/wiki/Aftermath_of_the_September_11_attacks
1393
+ September11Closings2001 = [
1394
+ Timestamp("2001-09-11", tz='UTC'),
1395
+ Timestamp("2001-09-12", tz='UTC'),
1396
+ Timestamp("2001-09-13", tz='UTC'),
1397
+ Timestamp("2001-09-14", tz='UTC')
1398
+ ]
1399
+
1400
+ Sept11MomentSilence933amLateOpen2001 = Holiday(
1401
+ 'Moment of silence for terrorist attacks on 9/11',
1402
+ month=9,
1403
+ day=17,
1404
+ start_date=Timestamp('2001-09-17'),
1405
+ end_date=Timestamp('2001-09-17'),
1406
+ )
1407
+
1408
+ EnduringFreedomMomentSilence931amLateOpen2001 = Holiday(
1409
+ 'Moment of silence for Enduring Freedom troops',
1410
+ month=10,
1411
+ day=8,
1412
+ start_date=Timestamp('2001-10-08'),
1413
+ end_date=Timestamp('2001-10-08'),
1414
+ )
1415
+ # 2002
1416
+ Sept11Anniversary12pmLateOpen2002 = Holiday(
1417
+ '1 year anniversary of terrorist attacks on 9/11',
1418
+ month=9,
1419
+ day=11,
1420
+ start_date=Timestamp('2002-09-11'),
1421
+ end_date=Timestamp('2002-09-11'),
1422
+ )
1423
+
1424
+ # 2003
1425
+ IraqiFreedom932amLateOpen2003 = Holiday(
1426
+ 'Operation Iraqi freedom moment of silence',
1427
+ month=3,
1428
+ day=20,
1429
+ start_date=Timestamp('2003-03-20'),
1430
+ end_date=Timestamp('2003-03-20'),
1431
+ )
1432
+
1433
+ # 2004
1434
+ ReaganMomentSilence932amLateOpen2004 = Holiday(
1435
+ 'Death of Former President Ronald Reagan moment of silence',
1436
+ month=6,
1437
+ day=7,
1438
+ start_date=Timestamp('2004-06-07'),
1439
+ end_date=Timestamp('2004-06-07'),
1440
+ )
1441
+
1442
+ ReaganMourning2004 = [Timestamp('2004-06-11', tz="UTC")]
1443
+
1444
+ # 2005
1445
+ SystemProb356pmEarlyClose2005 = Holiday(
1446
+ 'Systems Communication Problem',
1447
+ month=6,
1448
+ day=1,
1449
+ start_date=Timestamp('2005-06-01'),
1450
+ end_date=Timestamp('2005-06-01'),
1451
+ )
1452
+
1453
+ # 2006
1454
+ FordMomentSilence932amLateOpen2006 = Holiday(
1455
+ 'Former President Gerald Ford moment of silence',
1456
+ month=12,
1457
+ day=27,
1458
+ start_date=Timestamp('2006-12-27'),
1459
+ end_date=Timestamp('2006-12-27'),
1460
+ )
1461
+
1462
+ # 2007
1463
+ FordMourning2007 = [Timestamp('2007-01-02', tz='UTC'),]
1464
+
1465
+ # 2012
1466
+ # http://en.wikipedia.org/wiki/Hurricane_sandy
1467
+ HurricaneSandyClosings2012 = [Timestamp('2012-10-29', tz='UTC'),
1468
+ Timestamp('2012-10-30', tz='UTC')]
1469
+
1470
+ # 2018
1471
+ GeorgeHWBushDeath2018 = [Timestamp('2018-12-05', tz='UTC'),]
1472
+