pyalgotrading 2024.1.2__py3-none-any.whl → 2024.12.2__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 +8 -8
- {pyalgotrading-2024.1.2.dist-info → pyalgotrading-2024.12.2.dist-info}/METADATA +2 -6
- {pyalgotrading-2024.1.2.dist-info → pyalgotrading-2024.12.2.dist-info}/RECORD +8 -8
- {pyalgotrading-2024.1.2.dist-info → pyalgotrading-2024.12.2.dist-info}/WHEEL +1 -1
- {pyalgotrading-2024.1.2.dist-info → pyalgotrading-2024.12.2.dist-info}/LICENSE +0 -0
- {pyalgotrading-2024.1.2.dist-info → pyalgotrading-2024.12.2.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
|
@@ -299,14 +299,14 @@ class OptionsInstrumentDirection(Enum):
|
|
|
299
299
|
|
|
300
300
|
|
|
301
301
|
CandleIntervalSecondsMap = {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
302
|
+
CandleInterval.MINUTE_1.value: 60,
|
|
303
|
+
CandleInterval.MINUTE_3.value: 180,
|
|
304
|
+
CandleInterval.MINUTE_5.value: 300,
|
|
305
|
+
CandleInterval.MINUTE_10.value: 600,
|
|
306
|
+
CandleInterval.MINUTE_15.value: 900,
|
|
307
|
+
CandleInterval.MINUTE_30.value: 1800,
|
|
308
|
+
CandleInterval.MINUTE_60.value: 3600,
|
|
309
|
+
CandleInterval.DAY_1.value: 86400
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
KEY_DT_FORMAT_WITH_TIMEZONE = 0
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyalgotrading
|
|
3
|
-
Version: 2024.
|
|
3
|
+
Version: 2024.12.2
|
|
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=EvDHAIFdslw7Iynwl0etwBkbgTaBXWbC8q3iABVtVGo,7548
|
|
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.2.dist-info/LICENSE,sha256=-LLEprvixKS-LwHef99YQSOFon_tWeTwJRAWuUwwr1g,1066
|
|
32
|
+
pyalgotrading-2024.12.2.dist-info/METADATA,sha256=B3VhstjuEuwJ8D-TUqAKQ6cI4qqk25mQPHV9l2Xc-90,5830
|
|
33
|
+
pyalgotrading-2024.12.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
34
|
+
pyalgotrading-2024.12.2.dist-info/top_level.txt,sha256=A12PTnbXqO3gsZ0D0Gkyzf_OYRQxjJvtg3MqN-Ur2zY,14
|
|
35
|
+
pyalgotrading-2024.12.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|