siglab-py 0.1.28__py3-none-any.whl → 0.1.30__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.
- siglab_py/tests/unit/analytic_util_tests.py +29 -1
- siglab_py/util/analytic_util.py +2 -2
- {siglab_py-0.1.28.dist-info → siglab_py-0.1.30.dist-info}/METADATA +1 -1
- {siglab_py-0.1.28.dist-info → siglab_py-0.1.30.dist-info}/RECORD +6 -6
- {siglab_py-0.1.28.dist-info → siglab_py-0.1.30.dist-info}/WHEEL +0 -0
- {siglab_py-0.1.28.dist-info → siglab_py-0.1.30.dist-info}/top_level.txt +0 -0
|
@@ -41,5 +41,33 @@ class AnalyticUtilTests(unittest.TestCase):
|
|
|
41
41
|
pypy_compat=True
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
-
expected_columns : List[str] = [
|
|
44
|
+
expected_columns : List[str] = [
|
|
45
|
+
'exchange', 'symbol', 'timestamp_ms',
|
|
46
|
+
'open', 'high', 'low', 'close', 'volume',
|
|
47
|
+
'datetime', 'datetime_utc', 'year', 'month', 'day', 'hour', 'minute', 'dayofweek',
|
|
48
|
+
'pct_chg_on_close', 'candle_height',
|
|
49
|
+
'week_of_month', 'apac_trading_hr', 'emea_trading_hr', 'amer_trading_hr',
|
|
50
|
+
'is_green', 'pct_change_close',
|
|
51
|
+
'sma_short_periods', 'sma_long_periods', 'ema_short_periods', 'ema_long_periods', 'ema_close',
|
|
52
|
+
'std', 'std_percent', 'candle_height_percent', 'candle_height_percent_rounded',
|
|
53
|
+
'chop_against_ema',
|
|
54
|
+
'ema_volume_short_periods', 'ema_volume_long_periods',
|
|
55
|
+
'max_short_periods', 'max_long_periods', 'idmax_short_periods', 'idmax_long_periods', 'min_short_periods', 'min_long_periods', 'idmin_short_periods', 'idmin_long_periods',
|
|
56
|
+
'h_l', 'h_pc', 'l_pc', 'tr', 'atr',
|
|
57
|
+
'hurst_exp',
|
|
58
|
+
'boillenger_upper', 'boillenger_lower', 'boillenger_channel_height', 'boillenger_upper_agg', 'boillenger_lower_agg', 'boillenger_channel_height_agg',
|
|
59
|
+
'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',
|
|
60
|
+
'fvg_low', 'fvg_high', 'fvg_gap', 'fvg_mitigated',
|
|
61
|
+
'close_delta', 'close_delta_percent', 'up', 'down', 'rsi', 'ema_rsi', 'typical_price',
|
|
62
|
+
'money_flow', 'money_flow_positive', 'money_flow_negative', 'positive_flow_sum', 'negative_flow_sum', 'money_flow_ratio', 'mfi',
|
|
63
|
+
'macd', 'signal', 'macd_minus_signal',
|
|
64
|
+
'fib_618_short_periods', 'fib_618_long_periods',
|
|
65
|
+
'gap_close_vs_ema',
|
|
66
|
+
'close_above_or_below_ema',
|
|
67
|
+
'close_vs_ema_inflection'
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
missing_columns = [ expected for expected in expected_columns if expected not in pd_candles.columns.to_list() ]
|
|
71
|
+
unexpected_columns = [ actual for actual in pd_candles.columns.to_list() if actual not in expected_columns ]
|
|
72
|
+
|
|
45
73
|
assert(pd_candles.columns.to_list()==expected_columns)
|
siglab_py/util/analytic_util.py
CHANGED
|
@@ -99,8 +99,8 @@ def compute_candles_stats(
|
|
|
99
99
|
pd_candles['candle_height_percent_rounded'] = pd_candles['candle_height_percent'].round().astype(int)
|
|
100
100
|
|
|
101
101
|
pd_candles['chop_against_ema'] = (
|
|
102
|
-
(pd_candles['is_green'] & (pd_candles['close'] > pd_candles['ema_close'])) | # Case 1: Green candle and close > EMA
|
|
103
|
-
(
|
|
102
|
+
(~pd_candles['is_green'] & (pd_candles['close'] > pd_candles['ema_close'])) | # Case 1: Green candle and close > EMA
|
|
103
|
+
(pd_candles['is_green'] & (pd_candles['close'] < pd_candles['ema_close'])) # Case 2: Red candle and close < EMA
|
|
104
104
|
)
|
|
105
105
|
|
|
106
106
|
pd_candles['ema_volume_short_periods'] = pd_candles['volume'].ewm(span=sliding_window_how_many_candles/slow_fast_interval_ratio, adjust=False).mean()
|
|
@@ -21,14 +21,14 @@ siglab_py/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
21
21
|
siglab_py/tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
siglab_py/tests/integration/market_data_util_tests.py,sha256=X0CiSMDfsafKcmjVKknA03vUUbMV0fAZweb3D01ikYI,7174
|
|
23
23
|
siglab_py/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
|
-
siglab_py/tests/unit/analytic_util_tests.py,sha256=
|
|
24
|
+
siglab_py/tests/unit/analytic_util_tests.py,sha256=BzT__hxfqXMRAKvqtYDVYNrcMGGDF3-gFoXhxiJ0Lew,3703
|
|
25
25
|
siglab_py/tests/unit/market_data_util_tests.py,sha256=A1y83itISmMJdn6wLpfwcr4tGola8wTf1D1xbelMvgw,2026
|
|
26
26
|
siglab_py/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
|
-
siglab_py/util/analytic_util.py,sha256=
|
|
27
|
+
siglab_py/util/analytic_util.py,sha256=w3-ee13q7d6O-w45zafQdWeuKtYO2ycNW9Ek4MJTOuY,44042
|
|
28
28
|
siglab_py/util/aws_util.py,sha256=KGmjHrr1rpnnxr33nXHNzTul4tvyyxl9p6gpwNv0Ygc,2557
|
|
29
29
|
siglab_py/util/market_data_util.py,sha256=qRKsFKZMYsaC18ImSWug6dRAOo2_GS1NZM-j0EYMViE,19319
|
|
30
30
|
siglab_py/util/retry_util.py,sha256=mxYuRFZRZoaQQjENcwPmxhxixtd1TFvbxIdPx4RwfRc,743
|
|
31
|
-
siglab_py-0.1.
|
|
32
|
-
siglab_py-0.1.
|
|
33
|
-
siglab_py-0.1.
|
|
34
|
-
siglab_py-0.1.
|
|
31
|
+
siglab_py-0.1.30.dist-info/METADATA,sha256=qaTrOuk27oztMUHRGSahl7OwYFme9R7J-xbK6v0KjiE,980
|
|
32
|
+
siglab_py-0.1.30.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
33
|
+
siglab_py-0.1.30.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
|
|
34
|
+
siglab_py-0.1.30.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|