siglab-py 0.1.6__py3-none-any.whl → 0.1.7__py3-none-any.whl

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.

@@ -12,7 +12,7 @@ from ccxt.deribit import deribit
12
12
  from ccxt.base.exchange import Exchange
13
13
 
14
14
  # @unittest.skip("Skip all integration tests.")
15
- class MarketDataGizmoTests(unittest.TestCase):
15
+ class MarketDataUtilTests(unittest.TestCase):
16
16
 
17
17
  def test_fetch_candles_yahoo(self):
18
18
  start_date : datetime = datetime(2024, 1,1)
@@ -0,0 +1,41 @@
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
+ # @unittest.skip("Skip all integration tests.")
10
+ class AnalyticUtilTests(unittest.TestCase):
11
+
12
+ def test_compute_candle_stats(self):
13
+ '''
14
+ Folder structure:
15
+ \ siglab
16
+ \ siglab_py <-- python project root
17
+ \ sigab_py
18
+ __init__.py
19
+ \ util
20
+ __init__.py
21
+ market_data_util.py
22
+ \ tests
23
+ \ unit
24
+ __init__.py
25
+ analytic_util_tests.py <-- Tests here
26
+
27
+ \ siglab_rs <-- Rust project root
28
+ \ data <-- Data files here!
29
+ '''
30
+ data_dir = Path(__file__).parent.parent.parent.parent / "data"
31
+ csv_path = data_dir / "sample_btc_candles.csv"
32
+ pd_candles : pd.DataFrame = pd.read_csv(csv_path)
33
+ compute_candles_stats(
34
+ pd_candles=pd_candles,
35
+ boillenger_std_multiples=2,
36
+ sliding_window_how_many_candles=20,
37
+ pypy_compat=True
38
+ )
39
+
40
+ 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', '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']
41
+ assert(pd_candles.columns.to_list()==expected_columns)
@@ -3,6 +3,11 @@ from typing import Union, Dict
3
3
  '''
4
4
  https://gist.github.com/raphaelgabbarelli/bc5a41d93789046f9c71e4685f1463e7
5
5
  https://www.youtube.com/watch?v=CFEYKrP0vxs
6
+
7
+ If boto3 import complains: AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
8
+ python3 -m pip install pip --upgrade
9
+ pip install pyopenssl --upgrade
10
+ https://stackoverflow.com/questions/73830524/attributeerror-module-lib-has-no-attribute-x509-v-flag-cb-issuer-check
6
11
  '''
7
12
  import boto3
8
13
  import base64
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siglab-py
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: Market data fetches, TA calculations and generic order gateway.
5
5
  Author: r0bbarh00d
6
6
  Author-email: r0bbarh00d <r0bbarh00d@gmail.com>
@@ -16,14 +16,15 @@ siglab_py/ordergateway/gateway.py,sha256=xlTThsNRRHYWilpc3zpAcYC2nxG4crfpDY8Refb
16
16
  siglab_py/ordergateway/test_ordergateway.py,sha256=DH4djEZeWZr69lTx_xG9_N8S_E2wAG4S3430VisU5w4,3805
17
17
  siglab_py/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  siglab_py/tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- siglab_py/tests/integration/market_data_util_tests.py,sha256=_UyOMTTBW1VJ7rroyESoxmdhBCQzWSV2A14tAjV9J5U,5634
19
+ siglab_py/tests/integration/market_data_util_tests.py,sha256=igkDJAEkm4SLErkUwae1YbwdFPT22DC5CMtjOR-8DOk,5633
20
20
  siglab_py/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
+ siglab_py/tests/unit/analytic_util_tests.py,sha256=Z9D0eOv30orhBEZsh67czDfzcHoitopH--bK3Leh1II,2865
21
22
  siglab_py/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
23
  siglab_py/util/analytic_util.py,sha256=QLabbEMqM4rKKH2PE_LqxIyo-BUdCRhkLybLATBImcc,43438
23
- siglab_py/util/aws_util.py,sha256=x_duGDXJ6sO0wVpoRVDTMxECag7feA7zOwZweVLGl_w,2251
24
+ siglab_py/util/aws_util.py,sha256=KGmjHrr1rpnnxr33nXHNzTul4tvyyxl9p6gpwNv0Ygc,2557
24
25
  siglab_py/util/market_data_util.py,sha256=3qTq71xGvQXj0ORKJV50IN5FP_mCBF_gvdmlPyhdyco,16439
25
26
  siglab_py/util/retry_util.py,sha256=mxYuRFZRZoaQQjENcwPmxhxixtd1TFvbxIdPx4RwfRc,743
26
- siglab_py-0.1.6.dist-info/METADATA,sha256=-5cCWoewOwKri1IrLJG7rIeff4vbZpqDUQtQnxiTlDU,1096
27
- siglab_py-0.1.6.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
28
- siglab_py-0.1.6.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
29
- siglab_py-0.1.6.dist-info/RECORD,,
27
+ siglab_py-0.1.7.dist-info/METADATA,sha256=2JMUvAl4CKjHAqGz8k2iTqeaXXkp0Ij1Hp5Cp07tnkE,1096
28
+ siglab_py-0.1.7.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
29
+ siglab_py-0.1.7.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
30
+ siglab_py-0.1.7.dist-info/RECORD,,