siglab-py 0.1.32__tar.gz → 0.1.35__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.

Files changed (38) hide show
  1. {siglab_py-0.1.32 → siglab_py-0.1.35}/PKG-INFO +1 -1
  2. {siglab_py-0.1.32 → siglab_py-0.1.35}/pyproject.toml +1 -1
  3. {siglab_py-0.1.32 → siglab_py-0.1.35}/setup.cfg +1 -1
  4. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/util/analytic_util.py +18 -12
  5. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/util/market_data_util.py +1 -1
  6. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py.egg-info/PKG-INFO +1 -1
  7. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/__init__.py +0 -0
  8. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/constants.py +0 -0
  9. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/exchanges/__init__.py +0 -0
  10. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/exchanges/any_exchange.py +0 -0
  11. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/exchanges/futubull.py +0 -0
  12. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/market_data_providers/__init__.py +0 -0
  13. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/market_data_providers/aggregated_orderbook_provider.py +0 -0
  14. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/market_data_providers/candles_provider.py +0 -0
  15. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/market_data_providers/candles_ta_provider.py +0 -0
  16. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py +0 -0
  17. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/market_data_providers/deribit_options_expiry_provider.py +0 -0
  18. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py +0 -0
  19. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/market_data_providers/orderbooks_provider.py +0 -0
  20. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/market_data_providers/test_provider.py +0 -0
  21. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/ordergateway/__init__.py +0 -0
  22. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/ordergateway/client.py +0 -0
  23. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/ordergateway/encrypt_keys_util.py +0 -0
  24. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/ordergateway/gateway.py +0 -0
  25. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/ordergateway/test_ordergateway.py +0 -0
  26. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/tests/__init__.py +0 -0
  27. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/tests/integration/__init__.py +0 -0
  28. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/tests/integration/market_data_util_tests.py +0 -0
  29. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/tests/unit/__init__.py +0 -0
  30. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/tests/unit/analytic_util_tests.py +0 -0
  31. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/tests/unit/market_data_util_tests.py +0 -0
  32. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/util/__init__.py +0 -0
  33. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/util/aws_util.py +0 -0
  34. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py/util/retry_util.py +0 -0
  35. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py.egg-info/SOURCES.txt +0 -0
  36. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py.egg-info/dependency_links.txt +0 -0
  37. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py.egg-info/requires.txt +0 -0
  38. {siglab_py-0.1.32 → siglab_py-0.1.35}/siglab_py.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siglab_py
3
- Version: 0.1.32
3
+ Version: 0.1.35
4
4
  Summary: Market data fetches, TA calculations and generic order gateway.
5
5
  Author: r0bbarh00d
6
6
  Author-email: r0bbarh00d <r0bbarh00d@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "siglab_py"
7
- version = "0.1.32"
7
+ version = "0.1.35"
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"}
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = siglab_py
3
- version = 0.1.32
3
+ version = 0.1.35
4
4
  description = Market data fetches, TA calculations and generic order gateway.
5
5
  author = r0bbarh00d
6
6
  author_email = r0bbarh00d@gmail.com
@@ -86,11 +86,17 @@ def compute_candles_stats(
86
86
 
87
87
  pd_candles['is_green'] = pd_candles['close'] >= pd_candles['open']
88
88
 
89
+ close_short_periods_rolling = pd_candles['close'].rolling(window=int(sliding_window_how_many_candles/slow_fast_interval_ratio))
90
+ close_long_periods_rolling = pd_candles['close'].rolling(window=sliding_window_how_many_candles)
91
+ close_short_periods_ewm = pd_candles['close'].ewm(span=int(sliding_window_how_many_candles/slow_fast_interval_ratio), adjust=False)
92
+ close_long_periods_ewm = pd_candles['close'].ewm(span=sliding_window_how_many_candles, adjust=False)
93
+
94
+
89
95
  pd_candles['pct_change_close'] = pd_candles['close'].pct_change() * 100
90
- pd_candles['sma_short_periods'] = pd_candles['close'].rolling(window=int(sliding_window_how_many_candles/slow_fast_interval_ratio)).mean()
91
- pd_candles['sma_long_periods'] = pd_candles['close'].rolling(window=sliding_window_how_many_candles).mean()
92
- pd_candles['ema_short_periods'] = pd_candles['close'].ewm(span=int(sliding_window_how_many_candles/slow_fast_interval_ratio), adjust=False).mean()
93
- pd_candles['ema_long_periods'] = pd_candles['close'].ewm(span=sliding_window_how_many_candles, adjust=False).mean()
96
+ pd_candles['sma_short_periods'] = close_short_periods_rolling.mean()
97
+ pd_candles['sma_long_periods'] = close_long_periods_rolling.mean()
98
+ pd_candles['ema_short_periods'] = close_short_periods_ewm.mean()
99
+ pd_candles['ema_long_periods'] = close_long_periods_ewm.mean()
94
100
  pd_candles['ema_close'] = pd_candles['ema_long_periods'] # Alias, shorter name
95
101
  pd_candles['std'] = pd_candles['close'].rolling(window=sliding_window_how_many_candles).std()
96
102
 
@@ -106,15 +112,15 @@ def compute_candles_stats(
106
112
  pd_candles['ema_volume_short_periods'] = pd_candles['volume'].ewm(span=sliding_window_how_many_candles/slow_fast_interval_ratio, adjust=False).mean()
107
113
  pd_candles['ema_volume_long_periods'] = pd_candles['volume'].ewm(span=sliding_window_how_many_candles, adjust=False).mean()
108
114
 
109
- pd_candles['max_short_periods'] = pd_candles['close'].rolling(window=int(sliding_window_how_many_candles/slow_fast_interval_ratio)).max()
110
- pd_candles['max_long_periods'] = pd_candles['close'].rolling(window=sliding_window_how_many_candles).max()
111
- pd_candles['idmax_short_periods'] = pd_candles['close'].rolling(window=int(sliding_window_how_many_candles/slow_fast_interval_ratio)).apply(lambda x : x.idxmax())
112
- pd_candles['idmax_long_periods'] = pd_candles['close'].rolling(window=sliding_window_how_many_candles).apply(lambda x : x.idxmax())
115
+ pd_candles['max_short_periods'] = close_short_periods_rolling.max()
116
+ pd_candles['max_long_periods'] = close_long_periods_rolling.max()
117
+ pd_candles['idmax_short_periods'] = close_short_periods_rolling.apply(lambda x : x.idxmax())
118
+ pd_candles['idmax_long_periods'] = close_long_periods_rolling.apply(lambda x : x.idxmax())
113
119
 
114
- pd_candles['min_short_periods'] = pd_candles['close'].rolling(window=int(sliding_window_how_many_candles/slow_fast_interval_ratio)).min()
115
- pd_candles['min_long_periods'] = pd_candles['close'].rolling(window=sliding_window_how_many_candles).min()
116
- pd_candles['idmin_short_periods'] = pd_candles['close'].rolling(window=int(sliding_window_how_many_candles/slow_fast_interval_ratio)).apply(lambda x : x.idxmin())
117
- pd_candles['idmin_long_periods'] = pd_candles['close'].rolling(window=sliding_window_how_many_candles).apply(lambda x : x.idxmin())
120
+ pd_candles['min_short_periods'] = close_short_periods_rolling.min()
121
+ pd_candles['min_long_periods'] = close_long_periods_rolling.min()
122
+ pd_candles['idmin_short_periods'] = close_short_periods_rolling.apply(lambda x : x.idxmin())
123
+ pd_candles['idmin_long_periods'] = close_long_periods_rolling.apply(lambda x : x.idxmin())
118
124
 
119
125
 
120
126
  # ATR https://medium.com/codex/detecting-ranging-and-trending-markets-with-choppiness-index-in-python-1942e6450b58
@@ -19,7 +19,7 @@ from siglab_py.exchanges.futubull import Futubull
19
19
 
20
20
  def timestamp_to_datetime_cols(pd_candles : pd.DataFrame):
21
21
  pd_candles['datetime'] = pd_candles['timestamp_ms'].apply(
22
- lambda x: datetime.fromtimestamp(int(x.timestamp()) if isinstance(x, pd.Timestamp) else int(x / 1000))
22
+ lambda x: datetime.fromtimestamp(int(x.timestamp()) if isinstance(x, pd.Timestamp) else (int(x / 1000) if len(str(int(x)))==13 else int(x)) )
23
23
  )
24
24
  pd_candles['datetime'] = pd.to_datetime(pd_candles['datetime'])
25
25
  pd_candles['datetime'] = pd_candles['datetime'].dt.tz_localize(None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siglab-py
3
- Version: 0.1.32
3
+ Version: 0.1.35
4
4
  Summary: Market data fetches, TA calculations and generic order gateway.
5
5
  Author: r0bbarh00d
6
6
  Author-email: r0bbarh00d <r0bbarh00d@gmail.com>