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.
- pandas_market_calendars/__init__.py +39 -39
- pandas_market_calendars/calendar_registry.py +57 -57
- pandas_market_calendars/calendar_utils.py +1151 -1151
- pandas_market_calendars/calendars/asx.py +77 -70
- pandas_market_calendars/calendars/bmf.py +226 -219
- pandas_market_calendars/calendars/bse.py +432 -425
- pandas_market_calendars/calendars/cboe.py +156 -149
- pandas_market_calendars/calendars/cme.py +412 -405
- pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
- pandas_market_calendars/calendars/cme_globex_base.py +126 -119
- pandas_market_calendars/calendars/cme_globex_crypto.py +165 -158
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +223 -216
- pandas_market_calendars/calendars/cme_globex_equities.py +130 -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 +138 -131
- pandas_market_calendars/calendars/eurex_fixed_income.py +105 -98
- pandas_market_calendars/calendars/hkex.py +438 -431
- pandas_market_calendars/calendars/ice.py +88 -81
- pandas_market_calendars/calendars/iex.py +162 -155
- pandas_market_calendars/calendars/jpx.py +124 -117
- pandas_market_calendars/calendars/lse.py +125 -118
- pandas_market_calendars/calendars/mirror.py +144 -144
- pandas_market_calendars/calendars/nyse.py +1472 -1466
- pandas_market_calendars/calendars/ose.py +125 -118
- pandas_market_calendars/calendars/sifma.py +390 -383
- pandas_market_calendars/calendars/six.py +143 -136
- pandas_market_calendars/calendars/sse.py +322 -315
- pandas_market_calendars/calendars/tase.py +231 -224
- pandas_market_calendars/calendars/tsx.py +192 -185
- pandas_market_calendars/class_registry.py +115 -115
- pandas_market_calendars/holidays/cme.py +385 -385
- pandas_market_calendars/holidays/cme_globex.py +214 -214
- pandas_market_calendars/holidays/cn.py +1476 -1476
- pandas_market_calendars/holidays/jp.py +401 -401
- pandas_market_calendars/holidays/jpx_equinox.py +506 -506
- pandas_market_calendars/holidays/nyse.py +1536 -1536
- pandas_market_calendars/holidays/oz.py +63 -63
- pandas_market_calendars/holidays/sifma.py +350 -350
- pandas_market_calendars/holidays/us.py +376 -376
- pandas_market_calendars/market_calendar.py +1008 -1008
- {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/METADATA +3 -1
- pandas_market_calendars-5.1.1.dist-info/RECORD +50 -0
- {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/WHEEL +1 -1
- pandas_market_calendars-5.1.0.dist-info/RECORD +0 -50
- {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/LICENSE +0 -0
- {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/NOTICE +0 -0
- {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/top_level.txt +0 -0
@@ -1,172 +1,172 @@
|
|
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 abc import abstractmethod
|
17
|
-
from datetime import time
|
18
|
-
|
19
|
-
from pandas.tseries.holiday import (
|
20
|
-
AbstractHolidayCalendar,
|
21
|
-
GoodFriday,
|
22
|
-
USLaborDay,
|
23
|
-
USPresidentsDay,
|
24
|
-
USThanksgivingDay,
|
25
|
-
)
|
26
|
-
|
27
|
-
from pandas_market_calendars.holidays.us import (
|
28
|
-
Christmas,
|
29
|
-
ChristmasEveBefore1993,
|
30
|
-
ChristmasEveInOrAfter1993,
|
31
|
-
USBlackFridayInOrAfter1993,
|
32
|
-
USIndependenceDay,
|
33
|
-
USMartinLutherKingJrAfter1998,
|
34
|
-
USMemorialDay,
|
35
|
-
USNewYearsDay,
|
36
|
-
)
|
37
|
-
from .cme_globex_base import CMEGlobexBaseExchangeCalendar
|
38
|
-
|
39
|
-
|
40
|
-
class CMEGlobexAgricultureExchangeCalendar(CMEGlobexBaseExchangeCalendar):
|
41
|
-
"""
|
42
|
-
Exchange calendar for CME for Agriculture products
|
43
|
-
|
44
|
-
Products:
|
45
|
-
- Grains and Oilseeds (same trading hours and holidays)
|
46
|
-
- Livestock
|
47
|
-
- Dairy
|
48
|
-
- Fertilizer
|
49
|
-
- Lumber and Softs
|
50
|
-
|
51
|
-
|
52
|
-
"""
|
53
|
-
|
54
|
-
@property
|
55
|
-
@abstractmethod
|
56
|
-
def name(self):
|
57
|
-
"""
|
58
|
-
Name of the market
|
59
|
-
|
60
|
-
:return: string name
|
61
|
-
"""
|
62
|
-
raise NotImplementedError()
|
63
|
-
|
64
|
-
|
65
|
-
class CMEGlobexLivestockExchangeCalendar(CMEGlobexAgricultureExchangeCalendar):
|
66
|
-
"""
|
67
|
-
Exchange calendar for CME for Livestock products
|
68
|
-
|
69
|
-
https://www.cmegroup.com/trading/agricultural/livestock.html
|
70
|
-
|
71
|
-
GLOBEX Trading Times
|
72
|
-
https://www.cmegroup.com/markets/agriculture/livestock/live-cattle.contractSpecs.html
|
73
|
-
Monday - Friday: 8:30 a.m. - 1:05 p.m. CT
|
74
|
-
"""
|
75
|
-
|
76
|
-
aliases = [
|
77
|
-
"CMEGlobex_Livestock",
|
78
|
-
"CMEGlobex_Live_Cattle",
|
79
|
-
"CMEGlobex_Feeder_Cattle",
|
80
|
-
"CMEGlobex_Lean_Hog",
|
81
|
-
"CMEGlobex_Port_Cutout",
|
82
|
-
]
|
83
|
-
|
84
|
-
regular_market_times = {
|
85
|
-
"market_open": ((None, time(8, 30)),),
|
86
|
-
"market_close": ((None, time(13, 5)),),
|
87
|
-
}
|
88
|
-
|
89
|
-
@property
|
90
|
-
def name(self):
|
91
|
-
return "CMEGlobex_Livestock"
|
92
|
-
|
93
|
-
@property
|
94
|
-
def regular_holidays(self):
|
95
|
-
return AbstractHolidayCalendar(
|
96
|
-
rules=[
|
97
|
-
USNewYearsDay,
|
98
|
-
USMartinLutherKingJrAfter1998,
|
99
|
-
USPresidentsDay,
|
100
|
-
GoodFriday,
|
101
|
-
USMemorialDay,
|
102
|
-
USIndependenceDay,
|
103
|
-
USLaborDay,
|
104
|
-
USThanksgivingDay,
|
105
|
-
Christmas,
|
106
|
-
]
|
107
|
-
)
|
108
|
-
|
109
|
-
# @property
|
110
|
-
# def adhoc_holidays(self):
|
111
|
-
# return USNationalDaysofMourning
|
112
|
-
|
113
|
-
@property
|
114
|
-
def special_closes(self):
|
115
|
-
return [
|
116
|
-
(
|
117
|
-
time(12, 5),
|
118
|
-
AbstractHolidayCalendar(
|
119
|
-
rules=[
|
120
|
-
USBlackFridayInOrAfter1993,
|
121
|
-
ChristmasEveBefore1993,
|
122
|
-
ChristmasEveInOrAfter1993,
|
123
|
-
]
|
124
|
-
),
|
125
|
-
)
|
126
|
-
]
|
127
|
-
|
128
|
-
|
129
|
-
class CMEGlobexGrainsAndOilseedsExchangeCalendar(CMEGlobexAgricultureExchangeCalendar):
|
130
|
-
"""
|
131
|
-
Exchange calendar for CME for Grains & Oilseeds
|
132
|
-
|
133
|
-
https://www.cmegroup.com/trading/agricultural/grain-and-oilseed.html
|
134
|
-
|
135
|
-
GLOBEX Trading Times
|
136
|
-
https://www.cmegroup.com/markets/agriculture/oilseeds/soybean.contractSpecs.html
|
137
|
-
https://www.cmegroup.com/markets/agriculture/grains/corn.contractSpecs.html
|
138
|
-
https://www.cmegroup.com/markets/agriculture/grains/wheat.contractSpecs.html
|
139
|
-
Sunday - Friday: 7:00 p.m. - 7:45 a.m. CT and Monday - Friday: 8:30 a.m. - 1:20 p.m. CT
|
140
|
-
"""
|
141
|
-
|
142
|
-
aliases = [
|
143
|
-
"CMEGlobex_Grains",
|
144
|
-
"CMEGlobex_Oilseeds",
|
145
|
-
]
|
146
|
-
|
147
|
-
regular_market_times = {
|
148
|
-
"market_open": ((None, time(19), -1),), # offset by -1 day
|
149
|
-
"market_close": ((None, time(13, 20)),),
|
150
|
-
"break_start": ((None, time(7, 45)),),
|
151
|
-
"break_end": ((None, time(8, 30)),),
|
152
|
-
}
|
153
|
-
|
154
|
-
@property
|
155
|
-
def name(self):
|
156
|
-
return "CMEGlobex_GrainsAndOilseeds"
|
157
|
-
|
158
|
-
@property
|
159
|
-
def regular_holidays(self):
|
160
|
-
return AbstractHolidayCalendar(
|
161
|
-
rules=[
|
162
|
-
USNewYearsDay,
|
163
|
-
USMartinLutherKingJrAfter1998,
|
164
|
-
USPresidentsDay,
|
165
|
-
GoodFriday,
|
166
|
-
USMemorialDay,
|
167
|
-
USIndependenceDay,
|
168
|
-
USLaborDay,
|
169
|
-
USThanksgivingDay,
|
170
|
-
Christmas,
|
171
|
-
]
|
172
|
-
)
|
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 abc import abstractmethod
|
17
|
+
from datetime import time
|
18
|
+
|
19
|
+
from pandas.tseries.holiday import (
|
20
|
+
AbstractHolidayCalendar,
|
21
|
+
GoodFriday,
|
22
|
+
USLaborDay,
|
23
|
+
USPresidentsDay,
|
24
|
+
USThanksgivingDay,
|
25
|
+
)
|
26
|
+
|
27
|
+
from pandas_market_calendars.holidays.us import (
|
28
|
+
Christmas,
|
29
|
+
ChristmasEveBefore1993,
|
30
|
+
ChristmasEveInOrAfter1993,
|
31
|
+
USBlackFridayInOrAfter1993,
|
32
|
+
USIndependenceDay,
|
33
|
+
USMartinLutherKingJrAfter1998,
|
34
|
+
USMemorialDay,
|
35
|
+
USNewYearsDay,
|
36
|
+
)
|
37
|
+
from .cme_globex_base import CMEGlobexBaseExchangeCalendar
|
38
|
+
|
39
|
+
|
40
|
+
class CMEGlobexAgricultureExchangeCalendar(CMEGlobexBaseExchangeCalendar):
|
41
|
+
"""
|
42
|
+
Exchange calendar for CME for Agriculture products
|
43
|
+
|
44
|
+
Products:
|
45
|
+
- Grains and Oilseeds (same trading hours and holidays)
|
46
|
+
- Livestock
|
47
|
+
- Dairy
|
48
|
+
- Fertilizer
|
49
|
+
- Lumber and Softs
|
50
|
+
|
51
|
+
|
52
|
+
"""
|
53
|
+
|
54
|
+
@property
|
55
|
+
@abstractmethod
|
56
|
+
def name(self):
|
57
|
+
"""
|
58
|
+
Name of the market
|
59
|
+
|
60
|
+
:return: string name
|
61
|
+
"""
|
62
|
+
raise NotImplementedError()
|
63
|
+
|
64
|
+
|
65
|
+
class CMEGlobexLivestockExchangeCalendar(CMEGlobexAgricultureExchangeCalendar):
|
66
|
+
"""
|
67
|
+
Exchange calendar for CME for Livestock products
|
68
|
+
|
69
|
+
https://www.cmegroup.com/trading/agricultural/livestock.html
|
70
|
+
|
71
|
+
GLOBEX Trading Times
|
72
|
+
https://www.cmegroup.com/markets/agriculture/livestock/live-cattle.contractSpecs.html
|
73
|
+
Monday - Friday: 8:30 a.m. - 1:05 p.m. CT
|
74
|
+
"""
|
75
|
+
|
76
|
+
aliases = [
|
77
|
+
"CMEGlobex_Livestock",
|
78
|
+
"CMEGlobex_Live_Cattle",
|
79
|
+
"CMEGlobex_Feeder_Cattle",
|
80
|
+
"CMEGlobex_Lean_Hog",
|
81
|
+
"CMEGlobex_Port_Cutout",
|
82
|
+
]
|
83
|
+
|
84
|
+
regular_market_times = {
|
85
|
+
"market_open": ((None, time(8, 30)),),
|
86
|
+
"market_close": ((None, time(13, 5)),),
|
87
|
+
}
|
88
|
+
|
89
|
+
@property
|
90
|
+
def name(self):
|
91
|
+
return "CMEGlobex_Livestock"
|
92
|
+
|
93
|
+
@property
|
94
|
+
def regular_holidays(self):
|
95
|
+
return AbstractHolidayCalendar(
|
96
|
+
rules=[
|
97
|
+
USNewYearsDay,
|
98
|
+
USMartinLutherKingJrAfter1998,
|
99
|
+
USPresidentsDay,
|
100
|
+
GoodFriday,
|
101
|
+
USMemorialDay,
|
102
|
+
USIndependenceDay,
|
103
|
+
USLaborDay,
|
104
|
+
USThanksgivingDay,
|
105
|
+
Christmas,
|
106
|
+
]
|
107
|
+
)
|
108
|
+
|
109
|
+
# @property
|
110
|
+
# def adhoc_holidays(self):
|
111
|
+
# return USNationalDaysofMourning
|
112
|
+
|
113
|
+
@property
|
114
|
+
def special_closes(self):
|
115
|
+
return [
|
116
|
+
(
|
117
|
+
time(12, 5),
|
118
|
+
AbstractHolidayCalendar(
|
119
|
+
rules=[
|
120
|
+
USBlackFridayInOrAfter1993,
|
121
|
+
ChristmasEveBefore1993,
|
122
|
+
ChristmasEveInOrAfter1993,
|
123
|
+
]
|
124
|
+
),
|
125
|
+
)
|
126
|
+
]
|
127
|
+
|
128
|
+
|
129
|
+
class CMEGlobexGrainsAndOilseedsExchangeCalendar(CMEGlobexAgricultureExchangeCalendar):
|
130
|
+
"""
|
131
|
+
Exchange calendar for CME for Grains & Oilseeds
|
132
|
+
|
133
|
+
https://www.cmegroup.com/trading/agricultural/grain-and-oilseed.html
|
134
|
+
|
135
|
+
GLOBEX Trading Times
|
136
|
+
https://www.cmegroup.com/markets/agriculture/oilseeds/soybean.contractSpecs.html
|
137
|
+
https://www.cmegroup.com/markets/agriculture/grains/corn.contractSpecs.html
|
138
|
+
https://www.cmegroup.com/markets/agriculture/grains/wheat.contractSpecs.html
|
139
|
+
Sunday - Friday: 7:00 p.m. - 7:45 a.m. CT and Monday - Friday: 8:30 a.m. - 1:20 p.m. CT
|
140
|
+
"""
|
141
|
+
|
142
|
+
aliases = [
|
143
|
+
"CMEGlobex_Grains",
|
144
|
+
"CMEGlobex_Oilseeds",
|
145
|
+
]
|
146
|
+
|
147
|
+
regular_market_times = {
|
148
|
+
"market_open": ((None, time(19), -1),), # offset by -1 day
|
149
|
+
"market_close": ((None, time(13, 20)),),
|
150
|
+
"break_start": ((None, time(7, 45)),),
|
151
|
+
"break_end": ((None, time(8, 30)),),
|
152
|
+
}
|
153
|
+
|
154
|
+
@property
|
155
|
+
def name(self):
|
156
|
+
return "CMEGlobex_GrainsAndOilseeds"
|
157
|
+
|
158
|
+
@property
|
159
|
+
def regular_holidays(self):
|
160
|
+
return AbstractHolidayCalendar(
|
161
|
+
rules=[
|
162
|
+
USNewYearsDay,
|
163
|
+
USMartinLutherKingJrAfter1998,
|
164
|
+
USPresidentsDay,
|
165
|
+
GoodFriday,
|
166
|
+
USMemorialDay,
|
167
|
+
USIndependenceDay,
|
168
|
+
USLaborDay,
|
169
|
+
USThanksgivingDay,
|
170
|
+
Christmas,
|
171
|
+
]
|
172
|
+
)
|
@@ -1,119 +1,126 @@
|
|
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 abc import ABC, abstractmethod
|
17
|
-
|
18
|
-
from pandas.tseries.holiday import (
|
19
|
-
AbstractHolidayCalendar,
|
20
|
-
GoodFriday,
|
21
|
-
USLaborDay,
|
22
|
-
USPresidentsDay,
|
23
|
-
USThanksgivingDay,
|
24
|
-
)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
-
|
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 abc import ABC, abstractmethod
|
17
|
+
|
18
|
+
from pandas.tseries.holiday import (
|
19
|
+
AbstractHolidayCalendar,
|
20
|
+
GoodFriday,
|
21
|
+
USLaborDay,
|
22
|
+
USPresidentsDay,
|
23
|
+
USThanksgivingDay,
|
24
|
+
)
|
25
|
+
import sys
|
26
|
+
# check python versiOn aNd import accordingly
|
27
|
+
if sys.version_info >= (3, 9):
|
28
|
+
# For Python 3.9 and later, import directly
|
29
|
+
from zoneinfo import ZoneInfo
|
30
|
+
else:
|
31
|
+
# For Python 3.8 and earlier, import from backports
|
32
|
+
from backports.zoneinfo import ZoneInfo
|
33
|
+
|
34
|
+
from pandas_market_calendars.holidays.us import (
|
35
|
+
Christmas,
|
36
|
+
ChristmasEveBefore1993,
|
37
|
+
ChristmasEveInOrAfter1993,
|
38
|
+
USBlackFridayInOrAfter1993,
|
39
|
+
USIndependenceDay,
|
40
|
+
USMartinLutherKingJrAfter1998,
|
41
|
+
USMemorialDay,
|
42
|
+
USJuneteenthAfter2022,
|
43
|
+
USNewYearsDay,
|
44
|
+
)
|
45
|
+
from pandas_market_calendars.market_calendar import MarketCalendar
|
46
|
+
|
47
|
+
|
48
|
+
class CMEGlobexBaseExchangeCalendar(MarketCalendar, ABC):
|
49
|
+
"""
|
50
|
+
Base Exchange Calendar for CME.
|
51
|
+
|
52
|
+
CME Markets: https://www.cmegroup.com/markets/agriculture.html#overview
|
53
|
+
- Agriculture
|
54
|
+
- Crypto
|
55
|
+
- Energy
|
56
|
+
- Equity Index
|
57
|
+
- FX
|
58
|
+
- Interest Rates
|
59
|
+
- Metals
|
60
|
+
- Options
|
61
|
+
|
62
|
+
Holiays for which entire GLOBEX is closed:
|
63
|
+
- New Years Day
|
64
|
+
- Good Friday
|
65
|
+
- Christmas
|
66
|
+
|
67
|
+
Product Specific Closures:
|
68
|
+
- MLK Day
|
69
|
+
- Presidents Day
|
70
|
+
- Memorial Day
|
71
|
+
- Juneteenth
|
72
|
+
- US Independence Day
|
73
|
+
- US Labor Day
|
74
|
+
- US Thanksgiving Day
|
75
|
+
"""
|
76
|
+
|
77
|
+
@property
|
78
|
+
@abstractmethod
|
79
|
+
def name(self):
|
80
|
+
"""
|
81
|
+
Name of the market
|
82
|
+
|
83
|
+
:return: string name
|
84
|
+
"""
|
85
|
+
raise NotImplementedError()
|
86
|
+
|
87
|
+
@property
|
88
|
+
def tz(self):
|
89
|
+
return ZoneInfo("America/Chicago")
|
90
|
+
|
91
|
+
@property
|
92
|
+
def regular_holidays(self):
|
93
|
+
return AbstractHolidayCalendar(
|
94
|
+
rules=[
|
95
|
+
USNewYearsDay,
|
96
|
+
GoodFriday,
|
97
|
+
Christmas,
|
98
|
+
]
|
99
|
+
)
|
100
|
+
|
101
|
+
# I can't find any reference to these special closings onther than NYSE
|
102
|
+
# @property
|
103
|
+
# def adhoc_holidays(self):
|
104
|
+
# return USNationalDaysofMourning
|
105
|
+
|
106
|
+
@property
|
107
|
+
def special_closes(self):
|
108
|
+
return [
|
109
|
+
(
|
110
|
+
self.special_close_time,
|
111
|
+
AbstractHolidayCalendar(
|
112
|
+
rules=[
|
113
|
+
USMartinLutherKingJrAfter1998,
|
114
|
+
USPresidentsDay,
|
115
|
+
USMemorialDay,
|
116
|
+
USJuneteenthAfter2022,
|
117
|
+
USLaborDay,
|
118
|
+
USIndependenceDay,
|
119
|
+
USThanksgivingDay,
|
120
|
+
USBlackFridayInOrAfter1993,
|
121
|
+
ChristmasEveBefore1993,
|
122
|
+
ChristmasEveInOrAfter1993,
|
123
|
+
]
|
124
|
+
),
|
125
|
+
)
|
126
|
+
]
|