siglab-py 0.5.16__py3-none-any.whl → 0.5.18__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.
Potentially problematic release.
This version of siglab-py might be problematic. Click here for more details.
- siglab_py/tests/unit/analytic_util_tests.py +1 -1
- siglab_py/util/analytic_util.py +7 -4
- {siglab_py-0.5.16.dist-info → siglab_py-0.5.18.dist-info}/METADATA +5 -9
- {siglab_py-0.5.16.dist-info → siglab_py-0.5.18.dist-info}/RECORD +6 -6
- {siglab_py-0.5.16.dist-info → siglab_py-0.5.18.dist-info}/WHEEL +1 -1
- {siglab_py-0.5.16.dist-info → siglab_py-0.5.18.dist-info}/top_level.txt +0 -0
|
@@ -56,7 +56,7 @@ class AnalyticUtilTests(unittest.TestCase):
|
|
|
56
56
|
'chop_against_ema',
|
|
57
57
|
'ema_volume_short_periods', 'ema_volume_long_periods',
|
|
58
58
|
'max_short_periods', 'max_long_periods', 'idmax_short_periods', 'idmax_long_periods', 'min_short_periods', 'min_long_periods', 'idmin_short_periods', 'idmin_long_periods',
|
|
59
|
-
'h_l', 'h_pc', 'l_pc', 'tr', 'atr',
|
|
59
|
+
'h_l', 'h_pc', 'l_pc', 'tr', 'atr', 'atr_avg_short_periods', 'atr_avg_long_periods',
|
|
60
60
|
'hurst_exp',
|
|
61
61
|
'boillenger_upper', 'boillenger_lower', 'boillenger_channel_height', 'boillenger_upper_agg', 'boillenger_lower_agg', 'boillenger_channel_height_agg',
|
|
62
62
|
'aggressive_up', 'aggressive_up_index', 'aggressive_up_candle_height', 'aggressive_up_candle_high', 'aggressive_up_candle_low', 'aggressive_down', 'aggressive_down_index', 'aggressive_down_candle_height', 'aggressive_down_candle_high', 'aggressive_down_candle_low',
|
siglab_py/util/analytic_util.py
CHANGED
|
@@ -174,7 +174,9 @@ def compute_candles_stats(
|
|
|
174
174
|
pd_candles.loc[:,'l_pc'] = abs(pd_candles['low'] - pd_candles['close'].shift(1))
|
|
175
175
|
pd_candles.loc[:,'tr'] = pd_candles[['h_l', 'h_pc', 'l_pc']].max(axis=1)
|
|
176
176
|
pd_candles.loc[:,'atr'] = pd_candles['tr'].rolling(window=sliding_window_how_many_candles).mean()
|
|
177
|
-
|
|
177
|
+
pd_candles.loc[:,'atr_avg_short_periods'] = pd_candles['atr'].rolling(window=int(sliding_window_how_many_candles/slow_fast_interval_ratio)).mean()
|
|
178
|
+
pd_candles.loc[:,'atr_avg_long_periods'] = pd_candles['atr'].rolling(window=sliding_window_how_many_candles).mean()
|
|
179
|
+
|
|
178
180
|
|
|
179
181
|
'''
|
|
180
182
|
@hardcode @todo
|
|
@@ -374,9 +376,9 @@ def compute_candles_stats(
|
|
|
374
376
|
rsi_upper_threshold : float = 70,
|
|
375
377
|
rsi_lower_threshold : float = 30):
|
|
376
378
|
if row['rsi_idmax'] > row['rsi_idmin']:
|
|
377
|
-
return '
|
|
379
|
+
return 'down' if row.name > row['rsi_idmax'] and row['rsi'] <= rsi_upper_threshold else 'up'
|
|
378
380
|
else:
|
|
379
|
-
return '
|
|
381
|
+
return 'up' if row.name > row['rsi_idmin'] and row['rsi'] >= rsi_lower_threshold else 'down'
|
|
380
382
|
|
|
381
383
|
pd_candles['rsi_trend'] = pd_candles.apply(lambda row: rsi_trend(row), axis=1)
|
|
382
384
|
|
|
@@ -399,8 +401,9 @@ def compute_candles_stats(
|
|
|
399
401
|
|
|
400
402
|
|
|
401
403
|
# MACD https://www.investopedia.com/terms/m/macd.asp
|
|
404
|
+
# https://www.youtube.com/watch?v=jmPCL3l08ss
|
|
402
405
|
pd_candles['macd'] = pd_candles['ema_short_periods'] - pd_candles['ema_long_periods']
|
|
403
|
-
pd_candles['signal'] = pd_candles['macd'].ewm(span=
|
|
406
|
+
pd_candles['signal'] = pd_candles['macd'].ewm(span=int(sliding_window_how_many_candles/slow_fast_interval_ratio), adjust=False).mean()
|
|
404
407
|
pd_candles['macd_minus_signal'] = pd_candles['macd'] - pd_candles['signal']
|
|
405
408
|
|
|
406
409
|
if not pypy_compat:
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 0.5.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: siglab_py
|
|
3
|
+
Version: 0.5.18
|
|
4
4
|
Summary: Market data fetches, TA calculations and generic order gateway.
|
|
5
5
|
Author: r0bbarh00d
|
|
6
6
|
Author-email: r0bbarh00d <r0bbarh00d@gmail.com>
|
|
7
7
|
License: MIT
|
|
8
8
|
Project-URL: Homepage, https://github.com/r0bbar/siglab/blob/master/siglab_py/README.md
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
9
|
Requires-Python: >=3.9.19
|
|
13
10
|
Description-Content-Type: text/markdown
|
|
14
11
|
Requires-Dist: python-dotenv
|
|
15
12
|
Requires-Dist: dotmap
|
|
16
|
-
Requires-Dist:
|
|
13
|
+
Requires-Dist: typing_extensions
|
|
17
14
|
Requires-Dist: arrow
|
|
18
15
|
Requires-Dist: tzlocal
|
|
19
|
-
Requires-Dist:
|
|
16
|
+
Requires-Dist: nest_asyncio
|
|
20
17
|
Requires-Dist: pandas
|
|
21
18
|
Requires-Dist: numpy
|
|
22
19
|
Requires-Dist: boto3
|
|
@@ -29,4 +26,3 @@ Requires-Dist: hurst
|
|
|
29
26
|
Requires-Dist: redis
|
|
30
27
|
Requires-Dist: redis-py-cluster
|
|
31
28
|
Requires-Dist: kafka-python
|
|
32
|
-
|
|
@@ -22,18 +22,18 @@ siglab_py/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
22
22
|
siglab_py/tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
23
|
siglab_py/tests/integration/market_data_util_tests.py,sha256=p-RWIJZLyj0lAdfi4QTIeAttCm_e8mEVWFKh4OWuogU,7189
|
|
24
24
|
siglab_py/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
-
siglab_py/tests/unit/analytic_util_tests.py,sha256=
|
|
25
|
+
siglab_py/tests/unit/analytic_util_tests.py,sha256=vt6DKH-Flf9Og3gqivZ9W-sz5z-KcjKFQOEsWCDsWKs,3984
|
|
26
26
|
siglab_py/tests/unit/market_data_util_tests.py,sha256=A1y83itISmMJdn6wLpfwcr4tGola8wTf1D1xbelMvgw,2026
|
|
27
27
|
siglab_py/tests/unit/trading_util_tests.py,sha256=9DZmTZlW55lPtNfTCukgDdiyBiMYv9R4mEFWJIJiTNg,3870
|
|
28
28
|
siglab_py/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
-
siglab_py/util/analytic_util.py,sha256=
|
|
29
|
+
siglab_py/util/analytic_util.py,sha256=gA3kj-C18sqG1DGf6cr-6dx3DPERfpDtzv08ZIFO49A,49107
|
|
30
30
|
siglab_py/util/aws_util.py,sha256=KGmjHrr1rpnnxr33nXHNzTul4tvyyxl9p6gpwNv0Ygc,2557
|
|
31
31
|
siglab_py/util/market_data_util.py,sha256=mUXg4uaiX3b6_klgJWIEgnUQU4IUd6CwTOqKLiQWRlU,31307
|
|
32
32
|
siglab_py/util/notification_util.py,sha256=vySgHjpHgwFDLW0tHSi_AGh9JBbPc25IUgvWxmjAeT8,2658
|
|
33
33
|
siglab_py/util/retry_util.py,sha256=g-UU6pkPouWZZRZEqP99R2Z0lX5xzckYkzjwqqSDpVQ,922
|
|
34
34
|
siglab_py/util/slack_notification_util.py,sha256=G27n-adbT3Q6oaHSMvu_Nom794rrda5PprSF-zvmzkM,1912
|
|
35
35
|
siglab_py/util/trading_util.py,sha256=-TGNgJdy4HMDPgq31KQn_lRawFxuXnFU5NnLRb1XM5o,5757
|
|
36
|
-
siglab_py-0.5.
|
|
37
|
-
siglab_py-0.5.
|
|
38
|
-
siglab_py-0.5.
|
|
39
|
-
siglab_py-0.5.
|
|
36
|
+
siglab_py-0.5.18.dist-info/METADATA,sha256=M5SseNFH6bf_4JDo33YDDsVibWmvxi30sZZRlT4400I,829
|
|
37
|
+
siglab_py-0.5.18.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
|
|
38
|
+
siglab_py-0.5.18.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
|
|
39
|
+
siglab_py-0.5.18.dist-info/RECORD,,
|
|
File without changes
|