siglab-py 0.1.27__tar.gz → 0.1.28__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.1.27 → siglab_py-0.1.28}/PKG-INFO +1 -1
- {siglab_py-0.1.27 → siglab_py-0.1.28}/pyproject.toml +1 -1
- {siglab_py-0.1.27 → siglab_py-0.1.28}/setup.cfg +1 -1
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py +12 -1
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py +12 -1
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/tests/unit/analytic_util_tests.py +1 -1
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/util/analytic_util.py +2 -1
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py.egg-info/PKG-INFO +1 -1
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/__init__.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/constants.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/exchanges/__init__.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/exchanges/any_exchange.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/exchanges/futubull.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/__init__.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/aggregated_orderbook_provider.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/candles_provider.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/candles_ta_provider.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/deribit_options_expiry_provider.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/orderbooks_provider.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/test_provider.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/ordergateway/__init__.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/ordergateway/client.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/ordergateway/encrypt_keys_util.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/ordergateway/gateway.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/ordergateway/test_ordergateway.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/tests/__init__.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/tests/integration/__init__.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/tests/integration/market_data_util_tests.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/tests/unit/__init__.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/tests/unit/market_data_util_tests.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/util/__init__.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/util/aws_util.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/util/market_data_util.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/util/retry_util.py +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py.egg-info/SOURCES.txt +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py.egg-info/dependency_links.txt +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py.egg-info/requires.txt +0 -0
- {siglab_py-0.1.27 → siglab_py-0.1.28}/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.1.
|
|
7
|
+
version = "0.1.28"
|
|
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"}
|
{siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py
RENAMED
|
@@ -26,7 +26,7 @@ from siglab_py.util.analytic_util import compute_candles_stats
|
|
|
26
26
|
'''
|
|
27
27
|
Usage:
|
|
28
28
|
set PYTHONPATH=%PYTHONPATH%;D:\dev\siglab\siglab_py
|
|
29
|
-
python ccxt_candles_ta_to_csv.py --exchange_name bybit --symbol BTC/USDT:USDT --end_date "2025-03-11 0:0:0" --start_date "
|
|
29
|
+
python ccxt_candles_ta_to_csv.py --exchange_name bybit --symbol BTC/USDT:USDT --end_date "2025-03-11 0:0:0" --start_date "2021-03-11 0:0:0" --default_type linear --compute_ta Y --pypy_compatible N
|
|
30
30
|
|
|
31
31
|
(Remember: python -mpip install siglab_py)
|
|
32
32
|
|
|
@@ -35,6 +35,17 @@ This script is pypy compatible. Set "pypy_compatible" to True, in which case "co
|
|
|
35
35
|
|
|
36
36
|
(Remember: pypy -mpip install siglab_py)
|
|
37
37
|
|
|
38
|
+
Other arguments:
|
|
39
|
+
candle_size: default 1h (Hourly candles). You can specify 1d, 1m ...etc
|
|
40
|
+
ma_long_intervals (default 24), ma_short_intervals (default 8):
|
|
41
|
+
analytic_util.compute_candles_stats employ sliding windows to calculate things like std (Standard Deviation), EMA/SMAs, and actually most other technical indicators.
|
|
42
|
+
compute_candles_stats calculate certain things, for example EMA, in two levels: 'long' vs 'short'
|
|
43
|
+
'long' refers to 'higher timeframe' - this uses a bigger sliding window specified by 'ma_long_intervals'
|
|
44
|
+
'short' refers to 'lower timeframes' - this uses a smaller sliding window specified by 'ma_short_intervals'
|
|
45
|
+
|
|
46
|
+
compute_ta: Whether you wish to compute technical indicators? Y or N (Default)
|
|
47
|
+
pypy_compatible: Some technical indicators requires python libraries that's not pypy compatible, such as statsmodels.api (slopes and divergence calc) and scipy.stats.linregress. Set to Y, then analytic_util.compute_candles_stats will skip calculations which requires these libraries.
|
|
48
|
+
|
|
38
49
|
If debugging from VSCode, launch.json:
|
|
39
50
|
|
|
40
51
|
{
|
{siglab_py-0.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py
RENAMED
|
@@ -17,7 +17,7 @@ from siglab_py.util.analytic_util import compute_candles_stats
|
|
|
17
17
|
'''
|
|
18
18
|
Usage:
|
|
19
19
|
set PYTHONPATH=%PYTHONPATH%;D:\dev\siglab\siglab_py
|
|
20
|
-
python futu_candles_ta_to_csv.py --symbol HK.00700 --end_date "2025-03-11 0:0:0" --start_date "
|
|
20
|
+
python futu_candles_ta_to_csv.py --symbol HK.00700 --end_date "2025-03-11 0:0:0" --start_date "2021-03-11 0:0:0" --market HK --trdmarket HK --security_firm FUTUSECURITIES --security_type STOCK --compute_ta Y --pypy_compatible N
|
|
21
21
|
|
|
22
22
|
python futu_candles_ta_to_csv.py --symbol AAPL --end_date "2025-03-11 0:0:0" --start_date "2024-03-11 0:0:0" --market US --trdmarket US --security_firm FUTUSECURITIES --security_type STOCK --compute_ta Y --pypy_compatible N
|
|
23
23
|
|
|
@@ -28,6 +28,17 @@ This script is pypy compatible. Set "pypy_compatible" to True, in which case "co
|
|
|
28
28
|
|
|
29
29
|
(Remember: pypy -mpip install siglab_py)
|
|
30
30
|
|
|
31
|
+
Other arguments:
|
|
32
|
+
candle_size: default 1h (Hourly candles). You can specify 1d, 1m ...etc
|
|
33
|
+
ma_long_intervals (default 24), ma_short_intervals (default 8):
|
|
34
|
+
analytic_util.compute_candles_stats employ sliding windows to calculate things like std (Standard Deviation), EMA/SMAs, and actually most other technical indicators.
|
|
35
|
+
compute_candles_stats calculate certain things, for example EMA, in two levels: 'long' vs 'short'
|
|
36
|
+
'long' refers to 'higher timeframe' - this uses a bigger sliding window specified by 'ma_long_intervals'
|
|
37
|
+
'short' refers to 'lower timeframes' - this uses a smaller sliding window specified by 'ma_short_intervals'
|
|
38
|
+
|
|
39
|
+
compute_ta: Whether you wish to compute technical indicators? Y or N (Default)
|
|
40
|
+
pypy_compatible: Some technical indicators requires python libraries that's not pypy compatible, such as statsmodels.api (slopes and divergence calc) and scipy.stats.linregress. Set to Y, then analytic_util.compute_candles_stats will skip calculations which requires these libraries.
|
|
41
|
+
|
|
31
42
|
If debugging from VSCode, launch.json:
|
|
32
43
|
|
|
33
44
|
{
|
|
@@ -41,5 +41,5 @@ class AnalyticUtilTests(unittest.TestCase):
|
|
|
41
41
|
pypy_compat=True
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
-
expected_columns : List[str] = ['exchange', 'symbol', 'timestamp_ms', 'open', 'high', 'low', 'close', 'volume', 'datetime', 'datetime_utc', 'year', 'month', 'day', 'hour', 'minute', 'dayofweek', 'pct_chg_on_close', 'candle_height', 'is_green', 'pct_change_close', 'sma_short_periods', 'sma_long_periods', 'ema_short_periods', 'ema_long_periods', 'ema_close', 'std', 'std_percent', 'candle_height_percent', 'chop_against_ema', 'ema_volume_short_periods', 'ema_volume_long_periods', 'max_short_periods', 'max_long_periods', 'idmax_short_periods', 'idmax_long_periods', 'min_short_periods', 'min_long_periods', 'idmin_short_periods', 'idmin_long_periods', 'h_l', 'h_pc', 'l_pc', 'tr', 'atr', 'hurst_exp', 'boillenger_upper', 'boillenger_lower', 'boillenger_channel_height', 'boillenger_upper_agg', 'boillenger_lower_agg', 'boillenger_channel_height_agg', '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', 'fvg_low', 'fvg_high', 'fvg_gap', 'fvg_mitigated', 'close_delta', 'close_delta_percent', 'up', 'down', 'rsi', 'ema_rsi', 'typical_price', 'money_flow', 'money_flow_positive', 'money_flow_negative', 'positive_flow_sum', 'negative_flow_sum', 'money_flow_ratio', 'mfi', 'macd', 'signal', 'macd_minus_signal', 'fib_618_short_periods', 'fib_618_long_periods', 'gap_close_vs_ema', 'close_above_or_below_ema', 'close_vs_ema_inflection']
|
|
44
|
+
expected_columns : List[str] = ['exchange', 'symbol', 'timestamp_ms', 'open', 'high', 'low', 'close', 'volume', 'datetime', 'datetime_utc', 'year', 'month', 'day', 'hour', 'minute', 'dayofweek', 'pct_chg_on_close', 'candle_height', 'candle_height_percent', 'candle_height_percent_rounded', 'is_green', 'pct_change_close', 'sma_short_periods', 'sma_long_periods', 'ema_short_periods', 'ema_long_periods', 'ema_close', 'std', 'std_percent', 'candle_height_percent', 'chop_against_ema', 'ema_volume_short_periods', 'ema_volume_long_periods', 'max_short_periods', 'max_long_periods', 'idmax_short_periods', 'idmax_long_periods', 'min_short_periods', 'min_long_periods', 'idmin_short_periods', 'idmin_long_periods', 'h_l', 'h_pc', 'l_pc', 'tr', 'atr', 'hurst_exp', 'boillenger_upper', 'boillenger_lower', 'boillenger_channel_height', 'boillenger_upper_agg', 'boillenger_lower_agg', 'boillenger_channel_height_agg', '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', 'fvg_low', 'fvg_high', 'fvg_gap', 'fvg_mitigated', 'close_delta', 'close_delta_percent', 'up', 'down', 'rsi', 'ema_rsi', 'typical_price', 'money_flow', 'money_flow_positive', 'money_flow_negative', 'positive_flow_sum', 'negative_flow_sum', 'money_flow_ratio', 'mfi', 'macd', 'signal', 'macd_minus_signal', 'fib_618_short_periods', 'fib_618_long_periods', 'gap_close_vs_ema', 'close_above_or_below_ema', 'close_vs_ema_inflection']
|
|
45
45
|
assert(pd_candles.columns.to_list()==expected_columns)
|
|
@@ -96,7 +96,8 @@ def compute_candles_stats(
|
|
|
96
96
|
|
|
97
97
|
pd_candles['std_percent'] = pd_candles['std'] / pd_candles['ema_close'] * 100
|
|
98
98
|
pd_candles['candle_height_percent'] = pd_candles['candle_height'] / pd_candles['ema_close'] * 100
|
|
99
|
-
|
|
99
|
+
pd_candles['candle_height_percent_rounded'] = pd_candles['candle_height_percent'].round().astype(int)
|
|
100
|
+
|
|
100
101
|
pd_candles['chop_against_ema'] = (
|
|
101
102
|
(pd_candles['is_green'] & (pd_candles['close'] > pd_candles['ema_close'])) | # Case 1: Green candle and close > EMA
|
|
102
103
|
(~pd_candles['is_green'] & (pd_candles['close'] < pd_candles['ema_close'])) # Case 2: Red candle and close < EMA
|
|
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.1.27 → siglab_py-0.1.28}/siglab_py/market_data_providers/candles_ta_provider.py
RENAMED
|
File without changes
|
|
File without changes
|
{siglab_py-0.1.27 → siglab_py-0.1.28}/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
|