siglab-py 0.5.15__py3-none-any.whl → 0.5.17__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.

@@ -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',
@@ -66,7 +66,7 @@ class AnalyticUtilTests(unittest.TestCase):
66
66
  'typical_price',
67
67
  'money_flow', 'money_flow_positive', 'money_flow_negative', 'positive_flow_sum', 'negative_flow_sum', 'money_flow_ratio', 'mfi',
68
68
  'macd', 'signal', 'macd_minus_signal',
69
- 'fib_618_short_periods', 'fib_618_long_periods',
69
+ 'fib_0.618_short_periods', 'fib_0.618_long_periods',
70
70
  'gap_close_vs_ema',
71
71
  'close_above_or_below_ema',
72
72
  'close_vs_ema_inflection'
@@ -86,6 +86,7 @@ def compute_candles_stats(
86
86
  rsi_sliding_window_how_many_candles : Union[int, None] = None, # RSI standard 14
87
87
  hurst_exp_window_how_many_candles : Union[int, None] = None, # Hurst exp standard 100-200
88
88
  boillenger_std_multiples_for_aggressive_moves_detect : int = 3, # Aggressive moves if candle low/high breaches boillenger bands from 3 standard deviations.
89
+ target_fib_level : float = 0.618,
89
90
  pypy_compat : bool = True
90
91
  ):
91
92
  pd_candles['candle_height'] = pd_candles['high'] - pd_candles['low']
@@ -173,7 +174,9 @@ def compute_candles_stats(
173
174
  pd_candles.loc[:,'l_pc'] = abs(pd_candles['low'] - pd_candles['close'].shift(1))
174
175
  pd_candles.loc[:,'tr'] = pd_candles[['h_l', 'h_pc', 'l_pc']].max(axis=1)
175
176
  pd_candles.loc[:,'atr'] = pd_candles['tr'].rolling(window=sliding_window_how_many_candles).mean()
176
-
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
+
177
180
 
178
181
  '''
179
182
  @hardcode @todo
@@ -373,9 +376,9 @@ def compute_candles_stats(
373
376
  rsi_upper_threshold : float = 70,
374
377
  rsi_lower_threshold : float = 30):
375
378
  if row['rsi_idmax'] > row['rsi_idmin']:
376
- return 'DOWN' if row.name > row['rsi_idmax'] and row['rsi'] <= rsi_upper_threshold else 'up'
379
+ return 'down' if row.name > row['rsi_idmax'] and row['rsi'] <= rsi_upper_threshold else 'up'
377
380
  else:
378
- return 'UP' if row.name > row['rsi_idmin'] and row['rsi'] >= rsi_lower_threshold else 'down'
381
+ return 'up' if row.name > row['rsi_idmin'] and row['rsi'] >= rsi_lower_threshold else 'down'
379
382
 
380
383
  pd_candles['rsi_trend'] = pd_candles.apply(lambda row: rsi_trend(row), axis=1)
381
384
 
@@ -459,9 +462,8 @@ def compute_candles_stats(
459
462
 
460
463
 
461
464
  # Fibonacci
462
- TARGET_FIB_LEVEL = 0.618
463
- pd_candles['fib_618_short_periods'] = pd_candles.apply(lambda rw : estimate_fib_retracement(rw['min_short_periods'], rw['idmin_short_periods'], rw['max_short_periods'], rw['idmax_short_periods'], TARGET_FIB_LEVEL), axis=1)
464
- pd_candles['fib_618_long_periods'] = pd_candles.apply(lambda rw : estimate_fib_retracement(rw['min_long_periods'], rw['idmin_long_periods'], rw['max_long_periods'], rw['idmax_long_periods'], TARGET_FIB_LEVEL), axis=1)
465
+ pd_candles[f'fib_{target_fib_level}_short_periods'] = pd_candles.apply(lambda rw : estimate_fib_retracement(rw['min_short_periods'], rw['idmin_short_periods'], rw['max_short_periods'], rw['idmax_short_periods'], target_fib_level), axis=1)
466
+ pd_candles[f'fib_{target_fib_level}_long_periods'] = pd_candles.apply(lambda rw : estimate_fib_retracement(rw['min_long_periods'], rw['idmin_long_periods'], rw['max_long_periods'], rw['idmax_long_periods'], target_fib_level), axis=1)
465
467
 
466
468
 
467
469
  # Inflection points
@@ -1,22 +1,19 @@
1
- Metadata-Version: 2.1
2
- Name: siglab-py
3
- Version: 0.5.15
1
+ Metadata-Version: 2.4
2
+ Name: siglab_py
3
+ Version: 0.5.17
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: typing-extensions
13
+ Requires-Dist: typing_extensions
17
14
  Requires-Dist: arrow
18
15
  Requires-Dist: tzlocal
19
- Requires-Dist: nest-asyncio
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=4PPPgwvTCqgfgYV48j3vcJQM4w2ITUDBA0NE3doC_t8,3932
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=UGIpvnBuwy6z7l_YnGMSFFHSxTcH__MfljizvpK7Pbk,48674
29
+ siglab_py/util/analytic_util.py,sha256=OIwVqg7aFqyC4hjKCJb47abi5_Vg2vpBwVJvJcHOEgc,48996
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.15.dist-info/METADATA,sha256=a36d3u762HvS-yyiGyq2BU92RXECAIE9ytLGw1yOy4Y,980
37
- siglab_py-0.5.15.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
38
- siglab_py-0.5.15.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
39
- siglab_py-0.5.15.dist-info/RECORD,,
36
+ siglab_py-0.5.17.dist-info/METADATA,sha256=gSdQLHtOAyj6xweGHkEJYAQnLsybWxqpZHqcYZUcgPc,829
37
+ siglab_py-0.5.17.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
38
+ siglab_py-0.5.17.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
39
+ siglab_py-0.5.17.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: setuptools (78.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5