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

@@ -121,6 +121,12 @@ def compute_candles_stats(
121
121
  target_fib_level : float = 0.618,
122
122
  pypy_compat : bool = True
123
123
  ):
124
+ BUCKETS_m0_100 = bucket_series(
125
+ values=list([i for i in range(0,100)]),
126
+ outlier_threshold_percent=10,
127
+ level_granularity=0.1
128
+ )
129
+
124
130
  pd_candles['candle_height'] = pd_candles['high'] - pd_candles['low']
125
131
  pd_candles['candle_body_height'] = pd_candles['close'] - pd_candles['open']
126
132
 
@@ -474,7 +480,7 @@ def compute_candles_stats(
474
480
  lo_rs = lo_ma_up / lo_ma_down
475
481
  pd_candles.loc[:,'rsi'] = 100 - (100/(1 + lo_rs))
476
482
  rsi_buckets = bucket_series(
477
- values = pd_candles['rsi'].to_list(),
483
+ values = BUCKETS_m0_100,
478
484
  outlier_threshold_percent=10,
479
485
  level_granularity=0.1
480
486
  )
@@ -542,7 +548,7 @@ def compute_candles_stats(
542
548
  pd_candles['money_flow_ratio'] = pd_candles['positive_flow_sum'] / pd_candles['negative_flow_sum']
543
549
  pd_candles['mfi'] = 100 - (100 / (1 + pd_candles['money_flow_ratio']))
544
550
  mfi_buckets = bucket_series(
545
- values = pd_candles['mfi'].to_list(),
551
+ values = BUCKETS_m0_100,
546
552
  outlier_threshold_percent=10,
547
553
  level_granularity=0.1
548
554
  )
@@ -2,6 +2,8 @@ import math
2
2
  import random
3
3
  from typing import List, Dict, Union
4
4
 
5
+ from pandas import isna
6
+
5
7
  def generate_rand_nums(
6
8
  range_min : float = 0,
7
9
  range_max : float = 1,
@@ -35,6 +37,8 @@ def round_to_level(
35
37
  num : float,
36
38
  level_granularity : float = 0.01
37
39
  ) -> float:
40
+ if math.isnan(num):
41
+ return num
38
42
  level_size = num * level_granularity
39
43
  magnitude = math.floor(math.log10(abs(level_size)))
40
44
  base_increment = 10 ** magnitude
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: siglab_py
3
- Version: 0.5.61
3
+ Version: 0.5.63
4
4
  Summary: Market data fetches, TA calculations and generic order gateway.
5
5
  Author: r0bbarh00d
6
6
  Author-email: r0bbarh00d <r0bbarh00d@gmail.com>
@@ -27,15 +27,15 @@ siglab_py/tests/unit/market_data_util_tests.py,sha256=A1y83itISmMJdn6wLpfwcr4tGo
27
27
  siglab_py/tests/unit/simple_math_tests.py,sha256=rWqq93W4Vlqmu0UeZCmSOfLirr0gPh2ASVIZ8O77qXY,9653
28
28
  siglab_py/tests/unit/trading_util_tests.py,sha256=LiflZrduWXyLMbpSFQCaydA7jdJx3vFR-3KuKRRGhjQ,2927
29
29
  siglab_py/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- siglab_py/util/analytic_util.py,sha256=xbA5HPiL1UX8VdZwHzKh-pKSCdQuNIwSKlnsISgRq1M,62009
30
+ siglab_py/util/analytic_util.py,sha256=9XicYOf1Fip9TuQcFr6oUYsF9JlLW_DYhFvYQrqQrPU,62149
31
31
  siglab_py/util/aws_util.py,sha256=KGmjHrr1rpnnxr33nXHNzTul4tvyyxl9p6gpwNv0Ygc,2557
32
32
  siglab_py/util/market_data_util.py,sha256=mUXg4uaiX3b6_klgJWIEgnUQU4IUd6CwTOqKLiQWRlU,31307
33
33
  siglab_py/util/notification_util.py,sha256=tNZMUkkjz4q1CKqcQq62oEmZgHgNIwz2Iw9J22V22Zw,2668
34
34
  siglab_py/util/retry_util.py,sha256=g-UU6pkPouWZZRZEqP99R2Z0lX5xzckYkzjwqqSDpVQ,922
35
- siglab_py/util/simple_math.py,sha256=jc__dHMjgbrh4S35Yfc0-qXHG1nBtAN4ltc8lDzwxWI,7876
35
+ siglab_py/util/simple_math.py,sha256=h55FWAo2JYQv3nKiqwTBCFjA9KymPBeOWr-7k6kgpHs,7948
36
36
  siglab_py/util/slack_notification_util.py,sha256=G27n-adbT3Q6oaHSMvu_Nom794rrda5PprSF-zvmzkM,1912
37
37
  siglab_py/util/trading_util.py,sha256=dlIOzoMGnddLSFODcJ61EBH1Aeruq4IT2MsxIdFkV9I,5252
38
- siglab_py-0.5.61.dist-info/METADATA,sha256=HxxfzRRRnGMmeI6CPVYJk-tBnBAFAx8gnTZyBKfVbEY,829
39
- siglab_py-0.5.61.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
40
- siglab_py-0.5.61.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
41
- siglab_py-0.5.61.dist-info/RECORD,,
38
+ siglab_py-0.5.63.dist-info/METADATA,sha256=XvfRHsAULCtmobcKkJlAEf8imEHPV8K-69l-AsNyccg,829
39
+ siglab_py-0.5.63.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
40
+ siglab_py-0.5.63.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
41
+ siglab_py-0.5.63.dist-info/RECORD,,