siglab-py 0.1.28__tar.gz → 0.1.29__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.28 → siglab_py-0.1.29}/PKG-INFO +1 -1
- {siglab_py-0.1.28 → siglab_py-0.1.29}/pyproject.toml +1 -1
- {siglab_py-0.1.28 → siglab_py-0.1.29}/setup.cfg +1 -1
- siglab_py-0.1.29/siglab_py/tests/unit/analytic_util_tests.py +73 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py.egg-info/PKG-INFO +1 -1
- siglab_py-0.1.28/siglab_py/tests/unit/analytic_util_tests.py +0 -45
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/__init__.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/constants.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/exchanges/__init__.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/exchanges/any_exchange.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/exchanges/futubull.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/__init__.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/aggregated_orderbook_provider.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/candles_provider.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/candles_ta_provider.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/deribit_options_expiry_provider.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/orderbooks_provider.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/test_provider.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/ordergateway/__init__.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/ordergateway/client.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/ordergateway/encrypt_keys_util.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/ordergateway/gateway.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/ordergateway/test_ordergateway.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/tests/__init__.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/tests/integration/__init__.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/tests/integration/market_data_util_tests.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/tests/unit/__init__.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/tests/unit/market_data_util_tests.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/util/__init__.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/util/analytic_util.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/util/aws_util.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/util/market_data_util.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/util/retry_util.py +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py.egg-info/SOURCES.txt +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py.egg-info/dependency_links.txt +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py.egg-info/requires.txt +0 -0
- {siglab_py-0.1.28 → siglab_py-0.1.29}/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.29"
|
|
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"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from typing import List
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from util.analytic_util import compute_candles_stats
|
|
6
|
+
|
|
7
|
+
import pandas as pd
|
|
8
|
+
|
|
9
|
+
'''
|
|
10
|
+
Manual checks against for example Tradingview here: \siglab\siglab_py\tests\manual
|
|
11
|
+
'''
|
|
12
|
+
|
|
13
|
+
# @unittest.skip("Skip all integration tests.")
|
|
14
|
+
class AnalyticUtilTests(unittest.TestCase):
|
|
15
|
+
|
|
16
|
+
def test_compute_candle_stats(self):
|
|
17
|
+
'''
|
|
18
|
+
Folder structure:
|
|
19
|
+
\ siglab
|
|
20
|
+
\ siglab_py <-- python project root
|
|
21
|
+
\ sigab_py
|
|
22
|
+
__init__.py
|
|
23
|
+
\ util
|
|
24
|
+
__init__.py
|
|
25
|
+
market_data_util.py
|
|
26
|
+
\ tests
|
|
27
|
+
\ unit
|
|
28
|
+
__init__.py
|
|
29
|
+
analytic_util_tests.py <-- Tests here
|
|
30
|
+
|
|
31
|
+
\ siglab_rs <-- Rust project root
|
|
32
|
+
\ data <-- Data files here!
|
|
33
|
+
'''
|
|
34
|
+
data_dir = Path(__file__).parent.parent.parent.parent / "data"
|
|
35
|
+
csv_path = data_dir / "sample_btc_candles.csv"
|
|
36
|
+
pd_candles : pd.DataFrame = pd.read_csv(csv_path)
|
|
37
|
+
compute_candles_stats(
|
|
38
|
+
pd_candles=pd_candles,
|
|
39
|
+
boillenger_std_multiples=2,
|
|
40
|
+
sliding_window_how_many_candles=20,
|
|
41
|
+
pypy_compat=True
|
|
42
|
+
)
|
|
43
|
+
|
|
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
|
+
|
|
73
|
+
assert(pd_candles.columns.to_list()==expected_columns)
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import unittest
|
|
2
|
-
from typing import List
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
|
|
5
|
-
from util.analytic_util import compute_candles_stats
|
|
6
|
-
|
|
7
|
-
import pandas as pd
|
|
8
|
-
|
|
9
|
-
'''
|
|
10
|
-
Manual checks against for example Tradingview here: \siglab\siglab_py\tests\manual
|
|
11
|
-
'''
|
|
12
|
-
|
|
13
|
-
# @unittest.skip("Skip all integration tests.")
|
|
14
|
-
class AnalyticUtilTests(unittest.TestCase):
|
|
15
|
-
|
|
16
|
-
def test_compute_candle_stats(self):
|
|
17
|
-
'''
|
|
18
|
-
Folder structure:
|
|
19
|
-
\ siglab
|
|
20
|
-
\ siglab_py <-- python project root
|
|
21
|
-
\ sigab_py
|
|
22
|
-
__init__.py
|
|
23
|
-
\ util
|
|
24
|
-
__init__.py
|
|
25
|
-
market_data_util.py
|
|
26
|
-
\ tests
|
|
27
|
-
\ unit
|
|
28
|
-
__init__.py
|
|
29
|
-
analytic_util_tests.py <-- Tests here
|
|
30
|
-
|
|
31
|
-
\ siglab_rs <-- Rust project root
|
|
32
|
-
\ data <-- Data files here!
|
|
33
|
-
'''
|
|
34
|
-
data_dir = Path(__file__).parent.parent.parent.parent / "data"
|
|
35
|
-
csv_path = data_dir / "sample_btc_candles.csv"
|
|
36
|
-
pd_candles : pd.DataFrame = pd.read_csv(csv_path)
|
|
37
|
-
compute_candles_stats(
|
|
38
|
-
pd_candles=pd_candles,
|
|
39
|
-
boillenger_std_multiples=2,
|
|
40
|
-
sliding_window_how_many_candles=20,
|
|
41
|
-
pypy_compat=True
|
|
42
|
-
)
|
|
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', '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
|
-
assert(pd_candles.columns.to_list()==expected_columns)
|
|
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.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/candles_ta_provider.py
RENAMED
|
File without changes
|
{siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py
RENAMED
|
File without changes
|
|
File without changes
|
{siglab_py-0.1.28 → siglab_py-0.1.29}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py
RENAMED
|
File without changes
|
{siglab_py-0.1.28 → siglab_py-0.1.29}/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
|