siglab-py 0.5.28__tar.gz → 0.5.30__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.28 → siglab_py-0.5.30}/PKG-INFO +1 -1
- {siglab_py-0.5.28 → siglab_py-0.5.30}/pyproject.toml +1 -1
- {siglab_py-0.5.28 → siglab_py-0.5.30}/setup.cfg +1 -1
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/tests/unit/analytic_util_tests.py +1 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/util/analytic_util.py +29 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py.egg-info/PKG-INFO +1 -1
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/__init__.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/constants.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/exchanges/__init__.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/exchanges/any_exchange.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/exchanges/futubull.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/__init__.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/aggregated_orderbook_provider.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/candles_provider.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/candles_ta_provider.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/deribit_options_expiry_provider.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/orderbooks_provider.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/test_provider.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/tg_monitor.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/ordergateway/__init__.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/ordergateway/client.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/ordergateway/encrypt_keys_util.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/ordergateway/gateway.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/ordergateway/test_ordergateway.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/tests/__init__.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/tests/integration/__init__.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/tests/integration/market_data_util_tests.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/tests/unit/__init__.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/tests/unit/market_data_util_tests.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/tests/unit/trading_util_tests.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/util/__init__.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/util/aws_util.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/util/market_data_util.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/util/notification_util.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/util/retry_util.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/util/slack_notification_util.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/util/trading_util.py +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py.egg-info/SOURCES.txt +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py.egg-info/dependency_links.txt +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py.egg-info/requires.txt +0 -0
- {siglab_py-0.5.28 → siglab_py-0.5.30}/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.30"
|
|
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"}
|
|
@@ -55,6 +55,7 @@ class AnalyticUtilTests(unittest.TestCase):
|
|
|
55
55
|
'log_return', 'interval_hist_vol', 'annualized_hist_vol',
|
|
56
56
|
'chop_against_ema',
|
|
57
57
|
'ema_volume_short_periods', 'ema_volume_long_periods',
|
|
58
|
+
'ema_cross', 'ema_cross_last', 'ema_bullish_cross_last_id', 'ema_bearish_cross_last_id',
|
|
58
59
|
'max_short_periods', 'max_long_periods', 'idmax_short_periods', 'idmax_long_periods', 'min_short_periods', 'min_long_periods', 'idmin_short_periods', 'idmin_long_periods',
|
|
59
60
|
'price_swing_short_periods', 'price_swing_long_periods',
|
|
60
61
|
'trend_from_highs_long_periods', 'trend_from_lows_long_periods', 'trend_from_highs_short_periods', 'trend_from_lows_short_periods',
|
|
@@ -187,6 +187,35 @@ def compute_candles_stats(
|
|
|
187
187
|
pd_candles['ema_volume_short_periods'] = pd_candles['volume'].ewm(span=sliding_window_how_many_candles/slow_fast_interval_ratio, adjust=False).mean()
|
|
188
188
|
pd_candles['ema_volume_long_periods'] = pd_candles['volume'].ewm(span=sliding_window_how_many_candles, adjust=False).mean()
|
|
189
189
|
|
|
190
|
+
pd_candles['ema_cross'] = None
|
|
191
|
+
pd_candles['ema_cross_last'] = None
|
|
192
|
+
pd_candles['ema_bullish_cross_last_id'] = None
|
|
193
|
+
pd_candles['ema_bearish_cross_last_id'] = None
|
|
194
|
+
ema_short_periods_prev = pd_candles['ema_short_periods'].shift(1)
|
|
195
|
+
ema_long_periods_prev = pd_candles['ema_long_periods'].shift(1)
|
|
196
|
+
ema_short_periods_curr = pd_candles['ema_short_periods']
|
|
197
|
+
ema_long_periods_curr = pd_candles['ema_long_periods']
|
|
198
|
+
bullish_ema_crosses = (ema_short_periods_prev <= ema_long_periods_prev) & (ema_short_periods_curr > ema_long_periods_curr)
|
|
199
|
+
bearish_ema_crosses = (ema_short_periods_prev >= ema_long_periods_prev) & (ema_short_periods_curr < ema_long_periods_curr)
|
|
200
|
+
pd_candles.loc[bullish_ema_crosses, 'ema_cross'] = 1
|
|
201
|
+
pd_candles.loc[bearish_ema_crosses, 'ema_cross'] = -1
|
|
202
|
+
pd_candles['ema_bullish_cross_last_id'] = pd_candles['ema_cross'].rolling(window=sliding_window_how_many_candles).apply(lambda x : x.idxmax())
|
|
203
|
+
pd_candles['ema_bearish_cross_last_id'] = pd_candles['ema_cross'].rolling(window=sliding_window_how_many_candles).apply(lambda x : x.idxmin())
|
|
204
|
+
pd_candles['ema_cross_last'] = np.where(
|
|
205
|
+
pd_candles['ema_bullish_cross_last_id'] > pd_candles['ema_bearish_cross_last_id'],
|
|
206
|
+
'bullish',
|
|
207
|
+
np.where(
|
|
208
|
+
pd_candles['ema_bearish_cross_last_id'] > pd_candles['ema_bullish_cross_last_id'],
|
|
209
|
+
'bearish',
|
|
210
|
+
None # type: ignore
|
|
211
|
+
)
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
pd_candles['ema_cross_last'] = pd_candles['ema_cross_last'].where(
|
|
215
|
+
pd_candles['ema_bullish_cross_last_id'].isnull() & pd_candles['ema_bearish_cross_last_id'].isnull(),
|
|
216
|
+
None
|
|
217
|
+
)
|
|
218
|
+
|
|
190
219
|
pd_candles['max_short_periods'] = close_short_periods_rolling.max()
|
|
191
220
|
pd_candles['max_long_periods'] = close_long_periods_rolling.max()
|
|
192
221
|
pd_candles['idmax_short_periods'] = close_short_periods_rolling.apply(lambda x : x.idxmax())
|
|
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.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/candles_ta_provider.py
RENAMED
|
File without changes
|
{siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py
RENAMED
|
File without changes
|
|
File without changes
|
{siglab_py-0.5.28 → siglab_py-0.5.30}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py
RENAMED
|
File without changes
|
{siglab_py-0.5.28 → siglab_py-0.5.30}/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
|