siglab-py 0.5.73__tar.gz → 0.5.78__tar.gz
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-0.5.73 → siglab_py-0.5.78}/PKG-INFO +1 -1
- {siglab_py-0.5.73 → siglab_py-0.5.78}/pyproject.toml +1 -1
- {siglab_py-0.5.73 → siglab_py-0.5.78}/setup.cfg +1 -1
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/tests/unit/analytic_util_tests.py +1 -1
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/util/analytic_util.py +30 -1
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py.egg-info/PKG-INFO +1 -1
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/__init__.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/constants.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/exchanges/__init__.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/exchanges/any_exchange.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/exchanges/futubull.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/__init__.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/aggregated_orderbook_provider.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/candles_provider.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/candles_ta_provider.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/deribit_options_expiry_provider.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/google_monitor.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/orderbooks_provider.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/test_provider.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/tg_monitor.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/ordergateway/__init__.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/ordergateway/client.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/ordergateway/encrypt_keys_util.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/ordergateway/gateway.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/ordergateway/test_ordergateway.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/tests/__init__.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/tests/integration/__init__.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/tests/integration/market_data_util_tests.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/tests/unit/__init__.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/tests/unit/market_data_util_tests.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/tests/unit/simple_math_tests.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/tests/unit/trading_util_tests.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/util/__init__.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/util/aws_util.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/util/market_data_util.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/util/notification_util.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/util/retry_util.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/util/simple_math.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/util/slack_notification_util.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/util/trading_util.py +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py.egg-info/SOURCES.txt +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py.egg-info/dependency_links.txt +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py.egg-info/requires.txt +0 -0
- {siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "siglab_py"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.78"
|
|
8
8
|
description = "Market data fetches, TA calculations and generic order gateway."
|
|
9
9
|
authors = [{name = "r0bbarh00d", email = "r0bbarh00d@gmail.com"}]
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -47,7 +47,7 @@ class AnalyticUtilTests(unittest.TestCase):
|
|
|
47
47
|
'datetime', 'datetime_utc', 'year', 'month', 'day', 'hour', 'minute', 'dayofweek',
|
|
48
48
|
'pct_chg_on_close', 'candle_height', 'candle_body_height',
|
|
49
49
|
'week_of_month', 'apac_trading_hr', 'emea_trading_hr', 'amer_trading_hr',
|
|
50
|
-
'is_green', 'pct_change_close',
|
|
50
|
+
'is_green', 'candle_class', 'pct_change_close',
|
|
51
51
|
'sma_short_periods', 'sma_long_periods', 'ema_short_periods', 'ema_long_periods', 'ema_close',
|
|
52
52
|
'std', 'std_percent',
|
|
53
53
|
'vwap_short_periods', 'vwap_long_periods',
|
|
@@ -15,6 +15,33 @@ from siglab_py.util.simple_math import bucket_series, bucketize_val
|
|
|
15
15
|
from siglab_py.util.market_data_util import fix_column_types
|
|
16
16
|
from siglab_py.constants import TrendDirection
|
|
17
17
|
|
|
18
|
+
def classify_candle(
|
|
19
|
+
candle : pd.Series,
|
|
20
|
+
min_candle_height_ratio : float = 3
|
|
21
|
+
) -> Union[str, None]:
|
|
22
|
+
candle_class : Union[str, None] = None
|
|
23
|
+
open = candle['open']
|
|
24
|
+
high = candle['high']
|
|
25
|
+
low = candle['low']
|
|
26
|
+
close = candle['close']
|
|
27
|
+
candle_full_height = high - low # always positive
|
|
28
|
+
candle_body_height = close - open # can be negative
|
|
29
|
+
candle_height_ratio = candle_full_height / abs(candle_body_height) if candle_body_height!=0 else float('inf')
|
|
30
|
+
|
|
31
|
+
if (
|
|
32
|
+
candle_height_ratio>=min_candle_height_ratio
|
|
33
|
+
and close>low
|
|
34
|
+
):
|
|
35
|
+
candle_class = 'hammer'
|
|
36
|
+
elif (
|
|
37
|
+
candle_height_ratio>=min_candle_height_ratio
|
|
38
|
+
and close<high
|
|
39
|
+
):
|
|
40
|
+
candle_class = 'shooting_star'
|
|
41
|
+
# Keep add more ...
|
|
42
|
+
|
|
43
|
+
return candle_class
|
|
44
|
+
|
|
18
45
|
# Fibonacci
|
|
19
46
|
MAGIC_FIB_LEVELS = [0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.00, 1.618, 2.618, 3.618, 4.236]
|
|
20
47
|
|
|
@@ -145,6 +172,8 @@ def compute_candles_stats(
|
|
|
145
172
|
|
|
146
173
|
pd_candles['is_green'] = pd_candles['close'] >= pd_candles['open']
|
|
147
174
|
|
|
175
|
+
pd_candles['candle_class'] = pd_candles.apply(lambda row: classify_candle(row), axis=1)
|
|
176
|
+
|
|
148
177
|
close_short_periods_rolling = pd_candles['close'].rolling(window=int(sliding_window_how_many_candles/slow_fast_interval_ratio))
|
|
149
178
|
close_long_periods_rolling = pd_candles['close'].rolling(window=sliding_window_how_many_candles)
|
|
150
179
|
close_short_periods_ewm = pd_candles['close'].ewm(span=int(sliding_window_how_many_candles/slow_fast_interval_ratio), adjust=False)
|
|
@@ -447,7 +476,7 @@ def compute_candles_stats(
|
|
|
447
476
|
mitigated = pd_candles.iloc[idx + 1:row.name]['close'].lt(row['fvg_high']).any()
|
|
448
477
|
return mitigated
|
|
449
478
|
|
|
450
|
-
pd_candles['fvg_mitigated'] = pd_candles.apply(lambda row: compute_fvg_mitigated(row, pd_candles), axis=1)
|
|
479
|
+
pd_candles['fvg_mitigated'] = pd_candles.apply(lambda row: compute_fvg_mitigated(row, pd_candles), axis=1) # type: ignore
|
|
451
480
|
|
|
452
481
|
'''
|
|
453
482
|
RSI
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/candles_ta_provider.py
RENAMED
|
File without changes
|
{siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py
RENAMED
|
File without changes
|
|
File without changes
|
{siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py
RENAMED
|
File without changes
|
|
File without changes
|
{siglab_py-0.5.73 → siglab_py-0.5.78}/siglab_py/market_data_providers/orderbooks_provider.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|