pyalgotrading 2024.1.1__py3-none-any.whl → 2024.12.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.
- pyalgotrading/algobulls/api.py +5 -4
- pyalgotrading/algobulls/connection.py +5 -4
- pyalgotrading/constants.py +63 -63
- {pyalgotrading-2024.1.1.dist-info → pyalgotrading-2024.12.1.dist-info}/METADATA +2 -6
- {pyalgotrading-2024.1.1.dist-info → pyalgotrading-2024.12.1.dist-info}/RECORD +8 -8
- {pyalgotrading-2024.1.1.dist-info → pyalgotrading-2024.12.1.dist-info}/WHEEL +1 -1
- {pyalgotrading-2024.1.1.dist-info → pyalgotrading-2024.12.1.dist-info}/LICENSE +0 -0
- {pyalgotrading-2024.1.1.dist-info → pyalgotrading-2024.12.1.dist-info}/top_level.txt +0 -0
pyalgotrading/algobulls/api.py
CHANGED
|
@@ -267,7 +267,7 @@ class AlgoBullsAPI:
|
|
|
267
267
|
|
|
268
268
|
return response
|
|
269
269
|
|
|
270
|
-
def delete_previous_trades(self, strategy: str):
|
|
270
|
+
def delete_previous_trades(self, strategy: str, trading_type: TradingType):
|
|
271
271
|
"""
|
|
272
272
|
Delete the previous trades of given strategy
|
|
273
273
|
|
|
@@ -280,9 +280,10 @@ class AlgoBullsAPI:
|
|
|
280
280
|
Info: ENDPOINT
|
|
281
281
|
`DELETE` v3/build/python/user/strategy/deleteAll?strategyId={strategy}
|
|
282
282
|
"""
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
283
|
+
key = self.__get_key(strategy_code=strategy, trading_type=trading_type)
|
|
284
|
+
params = {'cstcId': key, 'strategyId': strategy}
|
|
285
|
+
endpoint = f'v3/build/python/user/strategy/deleteAll'
|
|
286
|
+
response = self._send_request(method='delete', endpoint=endpoint, params=params)
|
|
286
287
|
|
|
287
288
|
return response
|
|
288
289
|
|
|
@@ -226,18 +226,19 @@ class AlgoBullsConnection:
|
|
|
226
226
|
|
|
227
227
|
return response
|
|
228
228
|
|
|
229
|
-
def delete_previous_trades(self, strategy):
|
|
229
|
+
def delete_previous_trades(self, strategy, trading_type):
|
|
230
230
|
"""
|
|
231
231
|
Delete all the previous trades and clear the pnl table
|
|
232
232
|
|
|
233
233
|
Args:
|
|
234
234
|
strategy: Strategy code
|
|
235
235
|
"""
|
|
236
|
-
|
|
236
|
+
assert isinstance(strategy, str), f'Argument "strategy_code" should be a string'
|
|
237
|
+
assert isinstance(trading_type, TradingType), f'Argument "trading_type" should be an enum of type {TradingType.__name__}'
|
|
237
238
|
response = {}
|
|
238
239
|
for _ in range(30):
|
|
239
240
|
try:
|
|
240
|
-
response = self.api.delete_previous_trades(strategy)
|
|
241
|
+
response = self.api.delete_previous_trades(strategy, trading_type)
|
|
241
242
|
print(response.get('message'))
|
|
242
243
|
break
|
|
243
244
|
except AlgoBullsAPIGatewayTimeoutErrorException as ex:
|
|
@@ -826,7 +827,7 @@ class AlgoBullsConnection:
|
|
|
826
827
|
|
|
827
828
|
# delete previous trades
|
|
828
829
|
if delete_previous_trades and trading_type in [TradingType.BACKTESTING, TradingType.PAPERTRADING]:
|
|
829
|
-
self.delete_previous_trades(strategy_code)
|
|
830
|
+
self.delete_previous_trades(strategy_code, trading_type)
|
|
830
831
|
|
|
831
832
|
# Setup config for starting the job
|
|
832
833
|
strategy_config = {
|
pyalgotrading/constants.py
CHANGED
|
@@ -106,81 +106,81 @@ class CandleInterval(Enum):
|
|
|
106
106
|
# (Note: Before applying a user input to this enum, it is cleaned up - leading/trailing spaces removed, cases converted to caps, internal spaces converted to _.
|
|
107
107
|
# That way a user has lot of flexibility in entering the candle interval as a string)
|
|
108
108
|
|
|
109
|
-
_1_MINUTE = '
|
|
110
|
-
_1_MINUTES = '
|
|
111
|
-
_3_MINUTES = '
|
|
112
|
-
_5_MINUTES = '
|
|
113
|
-
_10_MINUTES = '
|
|
114
|
-
_15_MINUTES = '
|
|
115
|
-
_30_MINUTES = '
|
|
116
|
-
_60_MINUTES = '
|
|
117
|
-
_1_HOURS = '
|
|
118
|
-
_1_DAYS = '
|
|
119
|
-
_24_HOURS = '
|
|
109
|
+
_1_MINUTE = '1 Minute'
|
|
110
|
+
_1_MINUTES = '1 Minute'
|
|
111
|
+
_3_MINUTES = '3 Minutes'
|
|
112
|
+
_5_MINUTES = '5 Minutes'
|
|
113
|
+
_10_MINUTES = '10 Minutes'
|
|
114
|
+
_15_MINUTES = '15 Minutes'
|
|
115
|
+
_30_MINUTES = '30 Minutes'
|
|
116
|
+
_60_MINUTES = '60 Minutes'
|
|
117
|
+
_1_HOURS = '60 Minutes'
|
|
118
|
+
_1_DAYS = '1 Day'
|
|
119
|
+
_24_HOURS = '1 Day'
|
|
120
120
|
|
|
121
121
|
# Alternative names #1
|
|
122
|
-
_3_MINUTE = '
|
|
123
|
-
_5_MINUTE = '
|
|
124
|
-
_10_MINUTE = '
|
|
125
|
-
_15_MINUTE = '
|
|
126
|
-
_30_MINUTE = '
|
|
127
|
-
_60_MINUTE = '
|
|
128
|
-
_1_HOUR = '
|
|
129
|
-
_24_HOUR = '
|
|
130
|
-
_1_DAY = '
|
|
122
|
+
_3_MINUTE = '3 Minutes'
|
|
123
|
+
_5_MINUTE = '5 Minutes'
|
|
124
|
+
_10_MINUTE = '10 Minutes'
|
|
125
|
+
_15_MINUTE = '15 Minutes'
|
|
126
|
+
_30_MINUTE = '30 Minutes'
|
|
127
|
+
_60_MINUTE = '60 Minutes'
|
|
128
|
+
_1_HOUR = '60 Minutes'
|
|
129
|
+
_24_HOUR = '1 Day'
|
|
130
|
+
_1_DAY = '1 Day'
|
|
131
131
|
|
|
132
132
|
# Alternative names #2
|
|
133
|
-
_1MINUTE = '
|
|
134
|
-
_3MINUTE = '
|
|
135
|
-
_5MINUTE = '
|
|
136
|
-
_10MINUTE = '
|
|
137
|
-
_15MINUTE = '
|
|
138
|
-
_30MINUTE = '
|
|
139
|
-
_60MINUTE = '
|
|
140
|
-
_1HOUR = '
|
|
141
|
-
_24HOUR = '
|
|
142
|
-
_1DAY = '
|
|
133
|
+
_1MINUTE = '1 Minute'
|
|
134
|
+
_3MINUTE = '3 Minutes'
|
|
135
|
+
_5MINUTE = '5 Minutes'
|
|
136
|
+
_10MINUTE = '10 Minutes'
|
|
137
|
+
_15MINUTE = '15 Minutes'
|
|
138
|
+
_30MINUTE = '30 Minutes'
|
|
139
|
+
_60MINUTE = '60 Minutes'
|
|
140
|
+
_1HOUR = '60 Minutes'
|
|
141
|
+
_24HOUR = '1 Day'
|
|
142
|
+
_1DAY = '1 Day'
|
|
143
143
|
|
|
144
144
|
# Alternative names #3
|
|
145
|
-
_1MINUTES = '
|
|
146
|
-
_3MINUTES = '
|
|
147
|
-
_5MINUTES = '
|
|
148
|
-
_10MINUTES = '
|
|
149
|
-
_15MINUTES = '
|
|
150
|
-
_30MINUTES = '
|
|
151
|
-
_60MINUTES = '
|
|
152
|
-
_1HOURS = '
|
|
153
|
-
_24HOURS = '
|
|
154
|
-
_1DAYS = '
|
|
145
|
+
_1MINUTES = '1 Minute'
|
|
146
|
+
_3MINUTES = '3 Minutes'
|
|
147
|
+
_5MINUTES = '5 Minutes'
|
|
148
|
+
_10MINUTES = '10 Minutes'
|
|
149
|
+
_15MINUTES = '15 Minutes'
|
|
150
|
+
_30MINUTES = '30 Minutes'
|
|
151
|
+
_60MINUTES = '60 Minutes'
|
|
152
|
+
_1HOURS = '60 Minutes'
|
|
153
|
+
_24HOURS = '1 Day'
|
|
154
|
+
_1DAYS = '1 Day'
|
|
155
155
|
|
|
156
156
|
# Alternative names #4
|
|
157
|
-
MINUTES_1 = '
|
|
158
|
-
MINUTES_3 = '
|
|
159
|
-
MINUTES_5 = '
|
|
160
|
-
MINUTES_10 = '
|
|
161
|
-
MINUTES_15 = '
|
|
162
|
-
MINUTES_30 = '
|
|
163
|
-
MINUTES_60 = '
|
|
164
|
-
HOURS_1 = '
|
|
165
|
-
HOURS_24 = '
|
|
166
|
-
DAYS_1 = '
|
|
157
|
+
MINUTES_1 = '1 Minute'
|
|
158
|
+
MINUTES_3 = '3 Minutes'
|
|
159
|
+
MINUTES_5 = '5 Minutes'
|
|
160
|
+
MINUTES_10 = '10 Minutes'
|
|
161
|
+
MINUTES_15 = '15 Minutes'
|
|
162
|
+
MINUTES_30 = '30 Minutes'
|
|
163
|
+
MINUTES_60 = '60 Minutes'
|
|
164
|
+
HOURS_1 = '60 Minutes'
|
|
165
|
+
HOURS_24 = '1 Day'
|
|
166
|
+
DAYS_1 = '1 Day'
|
|
167
167
|
|
|
168
168
|
# Alternative names #5
|
|
169
|
-
MINUTE_1 = '
|
|
170
|
-
MINUTE_3 = '
|
|
171
|
-
MINUTE_5 = '
|
|
172
|
-
MINUTE_10 = '
|
|
173
|
-
MINUTE_15 = '
|
|
174
|
-
MINUTE_30 = '
|
|
175
|
-
MINUTE_60 = '
|
|
176
|
-
HOUR_1 = '
|
|
177
|
-
HOUR_24 = '
|
|
178
|
-
DAY_1 = '
|
|
169
|
+
MINUTE_1 = '1 Minute'
|
|
170
|
+
MINUTE_3 = '3 Minutes'
|
|
171
|
+
MINUTE_5 = '5 Minutes'
|
|
172
|
+
MINUTE_10 = '10 Minutes'
|
|
173
|
+
MINUTE_15 = '15 Minutes'
|
|
174
|
+
MINUTE_30 = '30 Minutes'
|
|
175
|
+
MINUTE_60 = '60 Minutes'
|
|
176
|
+
HOUR_1 = '60 Minutes'
|
|
177
|
+
HOUR_24 = '1 Day'
|
|
178
|
+
DAY_1 = '1 Day'
|
|
179
179
|
|
|
180
180
|
# Alternative names #6
|
|
181
|
-
MINUTE = '
|
|
182
|
-
HOUR = '
|
|
183
|
-
DAY = '
|
|
181
|
+
MINUTE = '1 Minute'
|
|
182
|
+
HOUR = '60 Minutes'
|
|
183
|
+
DAY = '1 Day'
|
|
184
184
|
|
|
185
185
|
|
|
186
186
|
class StrategyMode(Enum):
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyalgotrading
|
|
3
|
-
Version: 2024.
|
|
3
|
+
Version: 2024.12.1
|
|
4
4
|
Summary: Official Python Package for Algorithmic Trading APIs powered by AlgoBulls
|
|
5
5
|
Home-page: https://github.com/algobulls/pyalgotrading
|
|
6
6
|
Author: Pushpak Dagade
|
|
7
7
|
Author-email: pushpak@algobulls.com
|
|
8
|
-
License: UNKNOWN
|
|
9
8
|
Project-URL: Source, https://github.com/algobulls/pyalgotrading
|
|
10
9
|
Project-URL: Documentation, https://algobulls.github.io/pyalgotrading/
|
|
11
10
|
Project-URL: Bug Reports, https://github.com/algobulls/pyalgotrading/issues
|
|
12
11
|
Project-URL: Say Thanks!, https://saythanks.io/to/guanidene%40gmail.com
|
|
13
12
|
Keywords: algotrading algorithmictrading trading strategies algostrategies apis
|
|
14
|
-
Platform: UNKNOWN
|
|
15
13
|
Classifier: Development Status :: 3 - Alpha
|
|
16
14
|
Classifier: Intended Audience :: Developers
|
|
17
15
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
@@ -26,8 +24,8 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
26
24
|
Requires-Python: >=3.6
|
|
27
25
|
Description-Content-Type: text/markdown
|
|
28
26
|
License-File: LICENSE
|
|
29
|
-
Requires-Dist: pandas >=0.25.3
|
|
30
27
|
Requires-Dist: requests >=2.24.0
|
|
28
|
+
Requires-Dist: pandas >=0.25.3
|
|
31
29
|
|
|
32
30
|
# pyalgotrading
|
|
33
31
|
|
|
@@ -122,5 +120,3 @@ See [CHANGELOG.md](https://github.com/algobulls/pyalgotrading/blob/master/CHANGE
|
|
|
122
120
|
### License
|
|
123
121
|
|
|
124
122
|
See [LICENSE](https://github.com/algobulls/pyalgotrading/blob/master/LICENSE).
|
|
125
|
-
|
|
126
|
-
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
pyalgotrading/__init__.py,sha256=UzrsH5H2VlSxwdH8z0MnFqQoj_ggI6nEcVr4dLVFEeI,213
|
|
2
|
-
pyalgotrading/constants.py,sha256=
|
|
2
|
+
pyalgotrading/constants.py,sha256=D2PXZnOyO1U6lpmMY7HBo2tJVdxfA9MvSwxfj_QY3i0,7392
|
|
3
3
|
pyalgotrading/algobulls/__init__.py,sha256=IRkbWtJfgQnPH7gikjqpa6QsYnmk_NQ1lwtx7LPIC6c,133
|
|
4
|
-
pyalgotrading/algobulls/api.py,sha256=
|
|
5
|
-
pyalgotrading/algobulls/connection.py,sha256=
|
|
4
|
+
pyalgotrading/algobulls/api.py,sha256=P3BZL43Dv9Ke1vSU4Lv6cCwxibLi3zMXbq6z4hXNna4,19750
|
|
5
|
+
pyalgotrading/algobulls/connection.py,sha256=Wf3UecztkYT8gvrjjQHwrolaOJCerc8krOci2-iEIvE,59753
|
|
6
6
|
pyalgotrading/algobulls/exceptions.py,sha256=B96On8cN8tgtX7i4shKOlYfvjSjvspIRPbOpyF-jn0I,2187
|
|
7
7
|
pyalgotrading/broker/__init__.py,sha256=jXVWBVRlqzevKxNDqrPANJz9WubROBes8gaKcxcYz58,66
|
|
8
8
|
pyalgotrading/broker/broker_connection_base.py,sha256=vAJN5EAQuVfL8Ngf03wsaI5TTGdziCHKCb0bczGgSJ0,7594
|
|
@@ -28,8 +28,8 @@ pyalgotrading/utils/candlesticks/__init__.py,sha256=maIn__tvTvJDjldPhU9agBcNNuRO
|
|
|
28
28
|
pyalgotrading/utils/candlesticks/heikinashi.py,sha256=SpcuK7AYV0sgzcw-DMfLNtTDn2RfWqGvWBt4no7yKD4,2003
|
|
29
29
|
pyalgotrading/utils/candlesticks/linebreak.py,sha256=cYwoETMrenWOa06d03xASZoiou-qRz7n2mZYCi5ilEs,1434
|
|
30
30
|
pyalgotrading/utils/candlesticks/renko.py,sha256=zovQ6D658pBLas86FuTu9fU3-Kkv2hM-4h7OQJjdxng,2089
|
|
31
|
-
pyalgotrading-2024.
|
|
32
|
-
pyalgotrading-2024.
|
|
33
|
-
pyalgotrading-2024.
|
|
34
|
-
pyalgotrading-2024.
|
|
35
|
-
pyalgotrading-2024.
|
|
31
|
+
pyalgotrading-2024.12.1.dist-info/LICENSE,sha256=-LLEprvixKS-LwHef99YQSOFon_tWeTwJRAWuUwwr1g,1066
|
|
32
|
+
pyalgotrading-2024.12.1.dist-info/METADATA,sha256=oGmeHc3cASNYwYtux8trDMeQMLMpYRmfxrKRtGEe-bs,5830
|
|
33
|
+
pyalgotrading-2024.12.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
34
|
+
pyalgotrading-2024.12.1.dist-info/top_level.txt,sha256=A12PTnbXqO3gsZ0D0Gkyzf_OYRQxjJvtg3MqN-Ur2zY,14
|
|
35
|
+
pyalgotrading-2024.12.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|