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.
- pandas_market_calendars/__init__.py +39 -38
- pandas_market_calendars/calendar_registry.py +57 -53
- pandas_market_calendars/calendar_utils.py +1200 -261
- pandas_market_calendars/calendars/asx.py +66 -66
- pandas_market_calendars/calendars/bmf.py +223 -206
- pandas_market_calendars/calendars/bse.py +421 -407
- pandas_market_calendars/calendars/cboe.py +145 -145
- pandas_market_calendars/calendars/cme.py +405 -402
- pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -126
- pandas_market_calendars/calendars/cme_globex_base.py +119 -119
- pandas_market_calendars/calendars/cme_globex_crypto.py +160 -160
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -216
- pandas_market_calendars/calendars/cme_globex_equities.py +123 -123
- pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -136
- pandas_market_calendars/calendars/cme_globex_fx.py +101 -101
- pandas_market_calendars/calendars/eurex.py +131 -139
- pandas_market_calendars/calendars/eurex_fixed_income.py +98 -98
- pandas_market_calendars/calendars/hkex.py +429 -426
- pandas_market_calendars/calendars/ice.py +81 -81
- pandas_market_calendars/calendars/iex.py +151 -112
- pandas_market_calendars/calendars/jpx.py +113 -109
- pandas_market_calendars/calendars/lse.py +114 -114
- pandas_market_calendars/calendars/mirror.py +149 -130
- pandas_market_calendars/calendars/nyse.py +1466 -1324
- pandas_market_calendars/calendars/ose.py +116 -116
- pandas_market_calendars/calendars/sifma.py +354 -350
- pandas_market_calendars/calendars/six.py +132 -132
- pandas_market_calendars/calendars/sse.py +311 -311
- pandas_market_calendars/calendars/tase.py +220 -197
- pandas_market_calendars/calendars/tsx.py +181 -181
- pandas_market_calendars/holidays/cme.py +385 -385
- pandas_market_calendars/holidays/cme_globex.py +214 -214
- pandas_market_calendars/holidays/cn.py +1476 -1455
- pandas_market_calendars/holidays/jp.py +401 -398
- pandas_market_calendars/holidays/jpx_equinox.py +1 -0
- pandas_market_calendars/holidays/nyse.py +1536 -1531
- pandas_market_calendars/holidays/oz.py +63 -63
- pandas_market_calendars/holidays/sifma.py +350 -338
- pandas_market_calendars/holidays/us.py +376 -376
- pandas_market_calendars/market_calendar.py +1057 -895
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/METADATA +13 -9
- pandas_market_calendars-4.6.0.dist-info/RECORD +50 -0
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/WHEEL +1 -1
- pandas_market_calendars-4.3.3.dist-info/RECORD +0 -50
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/LICENSE +0 -0
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/NOTICE +0 -0
- {pandas_market_calendars-4.3.3.dist-info → pandas_market_calendars-4.6.0.dist-info}/top_level.txt +0 -0
@@ -1,402 +1,405 @@
|
|
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 pytz import timezone
|
28
|
-
|
29
|
-
from pandas_market_calendars.holidays.us import (
|
30
|
-
Christmas,
|
31
|
-
ChristmasEveBefore1993,
|
32
|
-
ChristmasEveInOrAfter1993,
|
33
|
-
USBlackFridayInOrAfter1993,
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
-
|
122
|
-
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
"
|
129
|
-
"
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
#
|
149
|
-
#
|
150
|
-
#
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
"
|
194
|
-
"
|
195
|
-
"
|
196
|
-
"
|
197
|
-
"
|
198
|
-
"
|
199
|
-
"
|
200
|
-
"
|
201
|
-
"
|
202
|
-
"
|
203
|
-
"
|
204
|
-
"
|
205
|
-
"
|
206
|
-
"
|
207
|
-
"
|
208
|
-
"
|
209
|
-
"
|
210
|
-
"
|
211
|
-
"
|
212
|
-
"
|
213
|
-
"
|
214
|
-
"
|
215
|
-
"
|
216
|
-
"
|
217
|
-
"
|
218
|
-
"
|
219
|
-
"
|
220
|
-
"
|
221
|
-
"
|
222
|
-
"
|
223
|
-
"
|
224
|
-
"
|
225
|
-
"
|
226
|
-
"
|
227
|
-
"
|
228
|
-
"
|
229
|
-
"
|
230
|
-
"
|
231
|
-
"
|
232
|
-
"
|
233
|
-
"
|
234
|
-
"
|
235
|
-
"
|
236
|
-
"
|
237
|
-
"
|
238
|
-
"
|
239
|
-
"
|
240
|
-
"
|
241
|
-
"
|
242
|
-
"
|
243
|
-
"
|
244
|
-
"
|
245
|
-
"
|
246
|
-
"
|
247
|
-
"
|
248
|
-
"
|
249
|
-
"
|
250
|
-
"
|
251
|
-
"
|
252
|
-
"
|
253
|
-
"
|
254
|
-
"
|
255
|
-
"
|
256
|
-
"
|
257
|
-
"
|
258
|
-
"
|
259
|
-
"
|
260
|
-
"
|
261
|
-
"
|
262
|
-
"
|
263
|
-
"
|
264
|
-
"
|
265
|
-
"
|
266
|
-
"
|
267
|
-
"
|
268
|
-
"
|
269
|
-
"
|
270
|
-
"
|
271
|
-
"
|
272
|
-
"
|
273
|
-
"
|
274
|
-
"
|
275
|
-
"
|
276
|
-
"
|
277
|
-
"
|
278
|
-
"
|
279
|
-
"
|
280
|
-
"
|
281
|
-
"
|
282
|
-
"
|
283
|
-
"
|
284
|
-
"
|
285
|
-
"
|
286
|
-
"
|
287
|
-
"
|
288
|
-
"
|
289
|
-
"
|
290
|
-
"
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
"
|
300
|
-
"
|
301
|
-
"
|
302
|
-
"
|
303
|
-
"
|
304
|
-
"
|
305
|
-
"
|
306
|
-
"
|
307
|
-
"
|
308
|
-
"
|
309
|
-
"
|
310
|
-
"
|
311
|
-
"
|
312
|
-
"
|
313
|
-
"
|
314
|
-
"
|
315
|
-
"
|
316
|
-
"
|
317
|
-
"
|
318
|
-
"
|
319
|
-
"
|
320
|
-
"
|
321
|
-
"
|
322
|
-
"
|
323
|
-
"
|
324
|
-
"
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
"
|
343
|
-
"
|
344
|
-
"
|
345
|
-
|
346
|
-
|
347
|
-
"
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
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 pytz import timezone
|
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 timezone("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 timezone("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 timezone("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)]
|