pandas-market-calendars 5.1.0__py3-none-any.whl → 5.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. pandas_market_calendars/__init__.py +39 -39
  2. pandas_market_calendars/calendar_registry.py +57 -57
  3. pandas_market_calendars/calendar_utils.py +1151 -1151
  4. pandas_market_calendars/calendars/asx.py +77 -70
  5. pandas_market_calendars/calendars/bmf.py +226 -219
  6. pandas_market_calendars/calendars/bse.py +432 -425
  7. pandas_market_calendars/calendars/cboe.py +156 -149
  8. pandas_market_calendars/calendars/cme.py +412 -405
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
  10. pandas_market_calendars/calendars/cme_globex_base.py +126 -119
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +165 -158
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +223 -216
  13. pandas_market_calendars/calendars/cme_globex_equities.py +130 -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 +138 -131
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +105 -98
  18. pandas_market_calendars/calendars/hkex.py +438 -431
  19. pandas_market_calendars/calendars/ice.py +88 -81
  20. pandas_market_calendars/calendars/iex.py +162 -155
  21. pandas_market_calendars/calendars/jpx.py +124 -117
  22. pandas_market_calendars/calendars/lse.py +125 -118
  23. pandas_market_calendars/calendars/mirror.py +144 -144
  24. pandas_market_calendars/calendars/nyse.py +1472 -1466
  25. pandas_market_calendars/calendars/ose.py +125 -118
  26. pandas_market_calendars/calendars/sifma.py +390 -383
  27. pandas_market_calendars/calendars/six.py +143 -136
  28. pandas_market_calendars/calendars/sse.py +322 -315
  29. pandas_market_calendars/calendars/tase.py +231 -224
  30. pandas_market_calendars/calendars/tsx.py +192 -185
  31. pandas_market_calendars/class_registry.py +115 -115
  32. pandas_market_calendars/holidays/cme.py +385 -385
  33. pandas_market_calendars/holidays/cme_globex.py +214 -214
  34. pandas_market_calendars/holidays/cn.py +1476 -1476
  35. pandas_market_calendars/holidays/jp.py +401 -401
  36. pandas_market_calendars/holidays/jpx_equinox.py +506 -506
  37. pandas_market_calendars/holidays/nyse.py +1536 -1536
  38. pandas_market_calendars/holidays/oz.py +63 -63
  39. pandas_market_calendars/holidays/sifma.py +350 -350
  40. pandas_market_calendars/holidays/us.py +376 -376
  41. pandas_market_calendars/market_calendar.py +1008 -1008
  42. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/METADATA +3 -1
  43. pandas_market_calendars-5.1.1.dist-info/RECORD +50 -0
  44. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/WHEEL +1 -1
  45. pandas_market_calendars-5.1.0.dist-info/RECORD +0 -50
  46. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/LICENSE +0 -0
  47. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/NOTICE +0 -0
  48. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/top_level.txt +0 -0
@@ -1,405 +1,412 @@
1
- #
2
- # Copyright 2016 Quantopian, Inc.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- from datetime import time
17
- from itertools import chain
18
-
19
- from pandas import Timestamp
20
- from pandas.tseries.holiday import (
21
- AbstractHolidayCalendar,
22
- GoodFriday,
23
- USLaborDay,
24
- USPresidentsDay,
25
- USThanksgivingDay,
26
- )
27
- from zoneinfo import ZoneInfo
28
-
29
- from pandas_market_calendars.holidays.us import (
30
- Christmas,
31
- ChristmasEveBefore1993,
32
- ChristmasEveInOrAfter1993,
33
- USBlackFridayInOrAfter1993,
34
- USJuneteenthAfter2022,
35
- USIndependenceDay,
36
- USMartinLutherKingJrAfter1998,
37
- USMemorialDay,
38
- USNationalDaysofMourning,
39
- USNewYearsDay,
40
- )
41
- from pandas_market_calendars.market_calendar import MarketCalendar
42
-
43
-
44
- # Useful resources for making changes to this file: http://www.cmegroup.com/tools-information/holiday-calendar.html
45
- # The CME has different holiday rules depending on the type of instrument.
46
- # For example, http://www.cmegroup.com/tools-information/holiday-calendar/files/2016-4th-of-july-holiday-schedule.pdf # noqa
47
- # shows that Equity, Interest Rate, FX, Energy, Metals & DME Products close at 1200 CT on July 4, 2016, while Grain,
48
- # Oilseed & MGEX Products and Livestock, Dairy & Lumber products are completely closed.
49
-
50
-
51
- class CMEEquityExchangeCalendar(MarketCalendar):
52
- """
53
- Exchange calendar for CME for Equity products
54
-
55
- Open Time: 6:00 PM, America/New_York / 5:00 PM Chicago
56
- Close Time: 5:00 PM, America/New_York / 4:00 PM Chicago
57
- Break: 4:15 - 4:30pm America/New_York / 3:15 - 3:30 PM Chicago
58
- """
59
-
60
- aliases = ["CME_Equity", "CBOT_Equity"]
61
- regular_market_times = {
62
- "market_open": ((None, time(17), -1),), # offset by -1 day
63
- "market_close": ((None, time(16)),),
64
- "break_start": ((None, time(15, 15)),),
65
- "break_end": ((None, time(15, 30)),),
66
- }
67
-
68
- @property
69
- def name(self):
70
- return "CME_Equity"
71
-
72
- @property
73
- def tz(self):
74
- return ZoneInfo("America/Chicago")
75
-
76
- @property
77
- def regular_holidays(self):
78
- # Many days that are holidays for the NYSE are an early close day for CME
79
- return AbstractHolidayCalendar(
80
- rules=[
81
- USNewYearsDay,
82
- GoodFriday,
83
- Christmas,
84
- ]
85
- )
86
-
87
- @property
88
- def adhoc_holidays(self):
89
- return USNationalDaysofMourning
90
-
91
- @property
92
- def special_closes(self):
93
- return [
94
- (
95
- time(12),
96
- AbstractHolidayCalendar(
97
- rules=[
98
- USMartinLutherKingJrAfter1998,
99
- USPresidentsDay,
100
- USMemorialDay,
101
- USLaborDay,
102
- USJuneteenthAfter2022,
103
- USIndependenceDay,
104
- USThanksgivingDay,
105
- USBlackFridayInOrAfter1993,
106
- ChristmasEveBefore1993,
107
- ChristmasEveInOrAfter1993,
108
- ]
109
- ),
110
- )
111
- ]
112
-
113
-
114
- class CMEAgricultureExchangeCalendar(MarketCalendar):
115
- """
116
- Exchange calendar for CME for Agriculture products
117
-
118
- Open Time: 5:00 PM, America/Chicago
119
- Close Time: 5:00 PM, America/Chicago
120
-
121
- Regularly-Observed Holidays:
122
- - New Years Day
123
- - Good Friday
124
- - Christmas
125
- """
126
-
127
- aliases = [
128
- "CME_Agriculture",
129
- "CBOT_Agriculture",
130
- "COMEX_Agriculture",
131
- "NYMEX_Agriculture",
132
- ]
133
- regular_market_times = {
134
- "market_open": ((None, time(17, 1), -1),), # offset by -1 day
135
- "market_close": ((None, time(17)),),
136
- }
137
-
138
- @property
139
- def name(self):
140
- return "CME_Agriculture"
141
-
142
- @property
143
- def tz(self):
144
- return ZoneInfo("America/Chicago")
145
-
146
- @property
147
- def regular_holidays(self):
148
- # Ignore gap between 13:20 CST and 14:30 CST for regular trading hours
149
- #
150
- # The CME has different holiday rules depending on the type of
151
- # instrument. For example, http://www.cmegroup.com/tools-information/holiday-calendar/files/2016-4th-of-july-holiday-schedule.pdf # noqa
152
- # shows that Equity, Interest Rate, FX, Energy, Metals & DME Products
153
- # close at 1200 CT on July 4, 2016, while Grain, Oilseed & MGEX
154
- # Products and Livestock, Dairy & Lumber products are completely
155
- # closed.
156
- return AbstractHolidayCalendar(
157
- rules=[
158
- USNewYearsDay,
159
- USMartinLutherKingJrAfter1998,
160
- USPresidentsDay,
161
- GoodFriday,
162
- USMemorialDay,
163
- USJuneteenthAfter2022,
164
- USIndependenceDay,
165
- USLaborDay,
166
- USThanksgivingDay,
167
- Christmas,
168
- ]
169
- )
170
-
171
- @property
172
- def adhoc_holidays(self):
173
- return USNationalDaysofMourning
174
-
175
- @property
176
- def special_closes(self):
177
- return [
178
- (
179
- time(12),
180
- AbstractHolidayCalendar(
181
- rules=[
182
- USBlackFridayInOrAfter1993,
183
- ChristmasEveBefore1993,
184
- ChristmasEveInOrAfter1993,
185
- ]
186
- ),
187
- )
188
- ]
189
-
190
-
191
- # For the bond market Good Friday that coincides with the release of NFP on the first friday of the month is an open day
192
- goodFridayClosed = [
193
- "1970-03-27",
194
- "1971-04-09",
195
- "1972-03-31",
196
- "1973-04-20",
197
- "1974-04-12",
198
- "1975-03-28",
199
- "1976-04-16",
200
- "1977-04-08",
201
- "1978-03-24",
202
- "1979-04-13",
203
- "1981-04-17",
204
- "1982-04-09",
205
- "1984-04-20",
206
- "1986-03-28",
207
- "1987-04-17",
208
- "1989-03-24",
209
- "1990-04-13",
210
- "1991-03-29",
211
- "1992-04-17",
212
- "1993-04-09",
213
- "1995-04-14",
214
- "1997-03-28",
215
- "1998-04-10",
216
- "2000-04-21",
217
- "2001-04-13",
218
- "2002-03-29",
219
- "2003-04-18",
220
- "2004-04-09",
221
- "2005-03-25",
222
- "2006-04-14",
223
- "2008-03-21",
224
- "2009-04-10",
225
- "2011-04-22",
226
- "2013-03-29",
227
- "2014-04-18",
228
- "2016-03-25",
229
- "2017-04-14",
230
- "2018-03-30",
231
- "2019-04-19",
232
- "2020-04-10",
233
- "2022-04-15",
234
- "2024-03-29",
235
- "2025-04-18",
236
- "2027-03-26",
237
- "2028-04-14",
238
- "2029-03-30",
239
- "2030-04-19",
240
- "2031-04-11",
241
- "2032-03-26",
242
- "2033-04-15",
243
- "2035-03-23",
244
- "2036-04-11",
245
- "2038-04-23",
246
- "2039-04-08",
247
- "2040-03-30",
248
- "2041-04-19",
249
- "2043-03-27",
250
- "2044-04-15",
251
- "2046-03-23",
252
- "2047-04-12",
253
- "2049-04-16",
254
- "2050-04-08",
255
- "2051-03-31",
256
- "2052-04-19",
257
- "2054-03-27",
258
- "2055-04-16",
259
- "2056-03-31",
260
- "2057-04-20",
261
- "2058-04-12",
262
- "2059-03-28",
263
- "2060-04-16",
264
- "2061-04-08",
265
- "2062-03-24",
266
- "2063-04-13",
267
- "2065-03-27",
268
- "2066-04-09",
269
- "2068-04-20",
270
- "2069-04-12",
271
- "2070-03-28",
272
- "2071-04-17",
273
- "2072-04-08",
274
- "2073-03-24",
275
- "2074-04-13",
276
- "2076-04-17",
277
- "2077-04-09",
278
- "2079-04-21",
279
- "2081-03-28",
280
- "2082-04-17",
281
- "2084-03-24",
282
- "2085-04-13",
283
- "2086-03-29",
284
- "2087-04-18",
285
- "2088-04-09",
286
- "2090-04-14",
287
- "2092-03-28",
288
- "2093-04-10",
289
- "2095-04-22",
290
- "2096-04-13",
291
- "2097-03-29",
292
- "2098-04-18",
293
- "2099-04-10",
294
- ]
295
-
296
- BondsGoodFridayClosed = [Timestamp(x, tz="UTC") for x in goodFridayClosed]
297
-
298
- goodFridayOpen = [
299
- "1980-04-04",
300
- "1983-04-01",
301
- "1985-04-05",
302
- "1988-04-01",
303
- "1994-04-01",
304
- "1996-04-05",
305
- "1999-04-02",
306
- "2007-04-06",
307
- "2010-04-02",
308
- "2012-04-06",
309
- "2015-04-03",
310
- "2021-04-02",
311
- "2023-04-07",
312
- "2026-04-03",
313
- "2034-04-07",
314
- "2037-04-03",
315
- "2042-04-04",
316
- "2045-04-07",
317
- "2048-04-03",
318
- "2053-04-04",
319
- "2064-04-04",
320
- "2067-04-01",
321
- "2075-04-05",
322
- "2078-04-01",
323
- "2080-04-05",
324
- "2083-04-02",
325
- "2089-04-01",
326
- "2091-04-06",
327
- "2094-04-02",
328
- ]
329
-
330
- BondsGoodFridayOpen = [Timestamp(x, tz="UTC") for x in goodFridayOpen]
331
-
332
-
333
- class CMEBondExchangeCalendar(MarketCalendar):
334
- """
335
- Exchange calendar for CME for Interest Rate and Bond products
336
-
337
- The Holiday calendar is different between the open outcry trading floor hours and GLOBEX electronic trading hours.
338
- This calendar attempts to be accurate for the GLOBEX holidays and hours from approx 2010 onward.
339
- """
340
-
341
- aliases = [
342
- "CME_Rate",
343
- "CBOT_Rate",
344
- "CME_InterestRate",
345
- "CBOT_InterestRate",
346
- "CME_Bond",
347
- "CBOT_Bond",
348
- ]
349
- regular_market_times = {
350
- "market_open": ((None, time(17), -1),), # offset by -1 day
351
- "market_close": ((None, time(16)),),
352
- }
353
-
354
- @property
355
- def name(self):
356
- return "CME_Bond"
357
-
358
- @property
359
- def tz(self):
360
- return ZoneInfo("America/Chicago")
361
-
362
- @property
363
- def regular_holidays(self):
364
- return AbstractHolidayCalendar(
365
- rules=[
366
- USNewYearsDay,
367
- Christmas,
368
- ]
369
- )
370
-
371
- @property
372
- def adhoc_holidays(self):
373
- return list(chain(USNationalDaysofMourning, BondsGoodFridayClosed))
374
-
375
- @property
376
- def special_closes(self):
377
- return [
378
- (
379
- time(12),
380
- AbstractHolidayCalendar(
381
- rules=[
382
- USMartinLutherKingJrAfter1998,
383
- USPresidentsDay,
384
- USMemorialDay,
385
- USIndependenceDay,
386
- USLaborDay,
387
- USThanksgivingDay,
388
- ]
389
- ),
390
- ),
391
- (
392
- time(12, 15),
393
- AbstractHolidayCalendar(
394
- rules=[
395
- USBlackFridayInOrAfter1993,
396
- ChristmasEveBefore1993,
397
- ChristmasEveInOrAfter1993,
398
- ]
399
- ),
400
- ),
401
- ]
402
-
403
- @property
404
- def special_closes_adhoc(self):
405
- return [(time(10, tzinfo=self.tz), BondsGoodFridayOpen)]
1
+ #
2
+ # Copyright 2016 Quantopian, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from datetime import time
17
+ from itertools import chain
18
+
19
+ from pandas import Timestamp
20
+ from pandas.tseries.holiday import (
21
+ AbstractHolidayCalendar,
22
+ GoodFriday,
23
+ USLaborDay,
24
+ USPresidentsDay,
25
+ USThanksgivingDay,
26
+ )
27
+ import sys
28
+ # check python versiOn aNd import accordingly
29
+ if sys.version_info >= (3, 9):
30
+ # For Python 3.9 and later, import directly
31
+ from zoneinfo import ZoneInfo
32
+ else:
33
+ # For Python 3.8 and earlier, import from backports
34
+ from backports.zoneinfo import ZoneInfo
35
+
36
+ from pandas_market_calendars.holidays.us import (
37
+ Christmas,
38
+ ChristmasEveBefore1993,
39
+ ChristmasEveInOrAfter1993,
40
+ USBlackFridayInOrAfter1993,
41
+ USJuneteenthAfter2022,
42
+ USIndependenceDay,
43
+ USMartinLutherKingJrAfter1998,
44
+ USMemorialDay,
45
+ USNationalDaysofMourning,
46
+ USNewYearsDay,
47
+ )
48
+ from pandas_market_calendars.market_calendar import MarketCalendar
49
+
50
+
51
+ # Useful resources for making changes to this file: http://www.cmegroup.com/tools-information/holiday-calendar.html
52
+ # The CME has different holiday rules depending on the type of instrument.
53
+ # For example, http://www.cmegroup.com/tools-information/holiday-calendar/files/2016-4th-of-july-holiday-schedule.pdf # noqa
54
+ # shows that Equity, Interest Rate, FX, Energy, Metals & DME Products close at 1200 CT on July 4, 2016, while Grain,
55
+ # Oilseed & MGEX Products and Livestock, Dairy & Lumber products are completely closed.
56
+
57
+
58
+ class CMEEquityExchangeCalendar(MarketCalendar):
59
+ """
60
+ Exchange calendar for CME for Equity products
61
+
62
+ Open Time: 6:00 PM, America/New_York / 5:00 PM Chicago
63
+ Close Time: 5:00 PM, America/New_York / 4:00 PM Chicago
64
+ Break: 4:15 - 4:30pm America/New_York / 3:15 - 3:30 PM Chicago
65
+ """
66
+
67
+ aliases = ["CME_Equity", "CBOT_Equity"]
68
+ regular_market_times = {
69
+ "market_open": ((None, time(17), -1),), # offset by -1 day
70
+ "market_close": ((None, time(16)),),
71
+ "break_start": ((None, time(15, 15)),),
72
+ "break_end": ((None, time(15, 30)),),
73
+ }
74
+
75
+ @property
76
+ def name(self):
77
+ return "CME_Equity"
78
+
79
+ @property
80
+ def tz(self):
81
+ return ZoneInfo("America/Chicago")
82
+
83
+ @property
84
+ def regular_holidays(self):
85
+ # Many days that are holidays for the NYSE are an early close day for CME
86
+ return AbstractHolidayCalendar(
87
+ rules=[
88
+ USNewYearsDay,
89
+ GoodFriday,
90
+ Christmas,
91
+ ]
92
+ )
93
+
94
+ @property
95
+ def adhoc_holidays(self):
96
+ return USNationalDaysofMourning
97
+
98
+ @property
99
+ def special_closes(self):
100
+ return [
101
+ (
102
+ time(12),
103
+ AbstractHolidayCalendar(
104
+ rules=[
105
+ USMartinLutherKingJrAfter1998,
106
+ USPresidentsDay,
107
+ USMemorialDay,
108
+ USLaborDay,
109
+ USJuneteenthAfter2022,
110
+ USIndependenceDay,
111
+ USThanksgivingDay,
112
+ USBlackFridayInOrAfter1993,
113
+ ChristmasEveBefore1993,
114
+ ChristmasEveInOrAfter1993,
115
+ ]
116
+ ),
117
+ )
118
+ ]
119
+
120
+
121
+ class CMEAgricultureExchangeCalendar(MarketCalendar):
122
+ """
123
+ Exchange calendar for CME for Agriculture products
124
+
125
+ Open Time: 5:00 PM, America/Chicago
126
+ Close Time: 5:00 PM, America/Chicago
127
+
128
+ Regularly-Observed Holidays:
129
+ - New Years Day
130
+ - Good Friday
131
+ - Christmas
132
+ """
133
+
134
+ aliases = [
135
+ "CME_Agriculture",
136
+ "CBOT_Agriculture",
137
+ "COMEX_Agriculture",
138
+ "NYMEX_Agriculture",
139
+ ]
140
+ regular_market_times = {
141
+ "market_open": ((None, time(17, 1), -1),), # offset by -1 day
142
+ "market_close": ((None, time(17)),),
143
+ }
144
+
145
+ @property
146
+ def name(self):
147
+ return "CME_Agriculture"
148
+
149
+ @property
150
+ def tz(self):
151
+ return ZoneInfo("America/Chicago")
152
+
153
+ @property
154
+ def regular_holidays(self):
155
+ # Ignore gap between 13:20 CST and 14:30 CST for regular trading hours
156
+ #
157
+ # The CME has different holiday rules depending on the type of
158
+ # instrument. For example, http://www.cmegroup.com/tools-information/holiday-calendar/files/2016-4th-of-july-holiday-schedule.pdf # noqa
159
+ # shows that Equity, Interest Rate, FX, Energy, Metals & DME Products
160
+ # close at 1200 CT on July 4, 2016, while Grain, Oilseed & MGEX
161
+ # Products and Livestock, Dairy & Lumber products are completely
162
+ # closed.
163
+ return AbstractHolidayCalendar(
164
+ rules=[
165
+ USNewYearsDay,
166
+ USMartinLutherKingJrAfter1998,
167
+ USPresidentsDay,
168
+ GoodFriday,
169
+ USMemorialDay,
170
+ USJuneteenthAfter2022,
171
+ USIndependenceDay,
172
+ USLaborDay,
173
+ USThanksgivingDay,
174
+ Christmas,
175
+ ]
176
+ )
177
+
178
+ @property
179
+ def adhoc_holidays(self):
180
+ return USNationalDaysofMourning
181
+
182
+ @property
183
+ def special_closes(self):
184
+ return [
185
+ (
186
+ time(12),
187
+ AbstractHolidayCalendar(
188
+ rules=[
189
+ USBlackFridayInOrAfter1993,
190
+ ChristmasEveBefore1993,
191
+ ChristmasEveInOrAfter1993,
192
+ ]
193
+ ),
194
+ )
195
+ ]
196
+
197
+
198
+ # For the bond market Good Friday that coincides with the release of NFP on the first friday of the month is an open day
199
+ goodFridayClosed = [
200
+ "1970-03-27",
201
+ "1971-04-09",
202
+ "1972-03-31",
203
+ "1973-04-20",
204
+ "1974-04-12",
205
+ "1975-03-28",
206
+ "1976-04-16",
207
+ "1977-04-08",
208
+ "1978-03-24",
209
+ "1979-04-13",
210
+ "1981-04-17",
211
+ "1982-04-09",
212
+ "1984-04-20",
213
+ "1986-03-28",
214
+ "1987-04-17",
215
+ "1989-03-24",
216
+ "1990-04-13",
217
+ "1991-03-29",
218
+ "1992-04-17",
219
+ "1993-04-09",
220
+ "1995-04-14",
221
+ "1997-03-28",
222
+ "1998-04-10",
223
+ "2000-04-21",
224
+ "2001-04-13",
225
+ "2002-03-29",
226
+ "2003-04-18",
227
+ "2004-04-09",
228
+ "2005-03-25",
229
+ "2006-04-14",
230
+ "2008-03-21",
231
+ "2009-04-10",
232
+ "2011-04-22",
233
+ "2013-03-29",
234
+ "2014-04-18",
235
+ "2016-03-25",
236
+ "2017-04-14",
237
+ "2018-03-30",
238
+ "2019-04-19",
239
+ "2020-04-10",
240
+ "2022-04-15",
241
+ "2024-03-29",
242
+ "2025-04-18",
243
+ "2027-03-26",
244
+ "2028-04-14",
245
+ "2029-03-30",
246
+ "2030-04-19",
247
+ "2031-04-11",
248
+ "2032-03-26",
249
+ "2033-04-15",
250
+ "2035-03-23",
251
+ "2036-04-11",
252
+ "2038-04-23",
253
+ "2039-04-08",
254
+ "2040-03-30",
255
+ "2041-04-19",
256
+ "2043-03-27",
257
+ "2044-04-15",
258
+ "2046-03-23",
259
+ "2047-04-12",
260
+ "2049-04-16",
261
+ "2050-04-08",
262
+ "2051-03-31",
263
+ "2052-04-19",
264
+ "2054-03-27",
265
+ "2055-04-16",
266
+ "2056-03-31",
267
+ "2057-04-20",
268
+ "2058-04-12",
269
+ "2059-03-28",
270
+ "2060-04-16",
271
+ "2061-04-08",
272
+ "2062-03-24",
273
+ "2063-04-13",
274
+ "2065-03-27",
275
+ "2066-04-09",
276
+ "2068-04-20",
277
+ "2069-04-12",
278
+ "2070-03-28",
279
+ "2071-04-17",
280
+ "2072-04-08",
281
+ "2073-03-24",
282
+ "2074-04-13",
283
+ "2076-04-17",
284
+ "2077-04-09",
285
+ "2079-04-21",
286
+ "2081-03-28",
287
+ "2082-04-17",
288
+ "2084-03-24",
289
+ "2085-04-13",
290
+ "2086-03-29",
291
+ "2087-04-18",
292
+ "2088-04-09",
293
+ "2090-04-14",
294
+ "2092-03-28",
295
+ "2093-04-10",
296
+ "2095-04-22",
297
+ "2096-04-13",
298
+ "2097-03-29",
299
+ "2098-04-18",
300
+ "2099-04-10",
301
+ ]
302
+
303
+ BondsGoodFridayClosed = [Timestamp(x, tz="UTC") for x in goodFridayClosed]
304
+
305
+ goodFridayOpen = [
306
+ "1980-04-04",
307
+ "1983-04-01",
308
+ "1985-04-05",
309
+ "1988-04-01",
310
+ "1994-04-01",
311
+ "1996-04-05",
312
+ "1999-04-02",
313
+ "2007-04-06",
314
+ "2010-04-02",
315
+ "2012-04-06",
316
+ "2015-04-03",
317
+ "2021-04-02",
318
+ "2023-04-07",
319
+ "2026-04-03",
320
+ "2034-04-07",
321
+ "2037-04-03",
322
+ "2042-04-04",
323
+ "2045-04-07",
324
+ "2048-04-03",
325
+ "2053-04-04",
326
+ "2064-04-04",
327
+ "2067-04-01",
328
+ "2075-04-05",
329
+ "2078-04-01",
330
+ "2080-04-05",
331
+ "2083-04-02",
332
+ "2089-04-01",
333
+ "2091-04-06",
334
+ "2094-04-02",
335
+ ]
336
+
337
+ BondsGoodFridayOpen = [Timestamp(x, tz="UTC") for x in goodFridayOpen]
338
+
339
+
340
+ class CMEBondExchangeCalendar(MarketCalendar):
341
+ """
342
+ Exchange calendar for CME for Interest Rate and Bond products
343
+
344
+ The Holiday calendar is different between the open outcry trading floor hours and GLOBEX electronic trading hours.
345
+ This calendar attempts to be accurate for the GLOBEX holidays and hours from approx 2010 onward.
346
+ """
347
+
348
+ aliases = [
349
+ "CME_Rate",
350
+ "CBOT_Rate",
351
+ "CME_InterestRate",
352
+ "CBOT_InterestRate",
353
+ "CME_Bond",
354
+ "CBOT_Bond",
355
+ ]
356
+ regular_market_times = {
357
+ "market_open": ((None, time(17), -1),), # offset by -1 day
358
+ "market_close": ((None, time(16)),),
359
+ }
360
+
361
+ @property
362
+ def name(self):
363
+ return "CME_Bond"
364
+
365
+ @property
366
+ def tz(self):
367
+ return ZoneInfo("America/Chicago")
368
+
369
+ @property
370
+ def regular_holidays(self):
371
+ return AbstractHolidayCalendar(
372
+ rules=[
373
+ USNewYearsDay,
374
+ Christmas,
375
+ ]
376
+ )
377
+
378
+ @property
379
+ def adhoc_holidays(self):
380
+ return list(chain(USNationalDaysofMourning, BondsGoodFridayClosed))
381
+
382
+ @property
383
+ def special_closes(self):
384
+ return [
385
+ (
386
+ time(12),
387
+ AbstractHolidayCalendar(
388
+ rules=[
389
+ USMartinLutherKingJrAfter1998,
390
+ USPresidentsDay,
391
+ USMemorialDay,
392
+ USIndependenceDay,
393
+ USLaborDay,
394
+ USThanksgivingDay,
395
+ ]
396
+ ),
397
+ ),
398
+ (
399
+ time(12, 15),
400
+ AbstractHolidayCalendar(
401
+ rules=[
402
+ USBlackFridayInOrAfter1993,
403
+ ChristmasEveBefore1993,
404
+ ChristmasEveInOrAfter1993,
405
+ ]
406
+ ),
407
+ ),
408
+ ]
409
+
410
+ @property
411
+ def special_closes_adhoc(self):
412
+ return [(time(10, tzinfo=self.tz), BondsGoodFridayOpen)]