pandas-market-calendars 4.3.3__py3-none-any.whl → 4.6.0__py3-none-any.whl

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