siglab-py 0.1.29__tar.gz → 0.1.31__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.29 → siglab_py-0.1.31}/PKG-INFO +1 -1
- {siglab_py-0.1.29 → siglab_py-0.1.31}/pyproject.toml +1 -1
- {siglab_py-0.1.29 → siglab_py-0.1.31}/setup.cfg +1 -1
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/ordergateway/client.py +3 -3
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/util/analytic_util.py +2 -2
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py.egg-info/PKG-INFO +1 -1
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/__init__.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/constants.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/exchanges/__init__.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/exchanges/any_exchange.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/exchanges/futubull.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/__init__.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/aggregated_orderbook_provider.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/candles_provider.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/candles_ta_provider.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/deribit_options_expiry_provider.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/orderbooks_provider.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/test_provider.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/ordergateway/__init__.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/ordergateway/encrypt_keys_util.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/ordergateway/gateway.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/ordergateway/test_ordergateway.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/tests/__init__.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/tests/integration/__init__.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/tests/integration/market_data_util_tests.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/tests/unit/__init__.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/tests/unit/analytic_util_tests.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/tests/unit/market_data_util_tests.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/util/__init__.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/util/aws_util.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/util/market_data_util.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/util/retry_util.py +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py.egg-info/SOURCES.txt +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py.egg-info/dependency_links.txt +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py.egg-info/requires.txt +0 -0
- {siglab_py-0.1.29 → siglab_py-0.1.31}/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.31"
|
|
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"}
|
|
@@ -138,7 +138,7 @@ class DivisiblePosition(Order):
|
|
|
138
138
|
|
|
139
139
|
def get_filled_amount(self) -> float:
|
|
140
140
|
# filled_amount is in base ccy
|
|
141
|
-
filled_amount = sum([ self.executions[order_id]['filled'] * self.multiplier for order_id in self.executions ])
|
|
141
|
+
filled_amount = sum([ self.executions[order_id]['filled'] if 'filled' in self.executions[order_id] else 0 * self.multiplier for order_id in self.executions ])
|
|
142
142
|
if self.side=='sell':
|
|
143
143
|
filled_amount = -1 * filled_amount
|
|
144
144
|
return filled_amount
|
|
@@ -189,14 +189,14 @@ class DivisiblePosition(Order):
|
|
|
189
189
|
}
|
|
190
190
|
'''
|
|
191
191
|
total_amount : float = sum([ self.executions[order_id]['amount'] for order_id in self.executions ])
|
|
192
|
-
average_cost = sum([ (self.executions[order_id]['average'] if self.executions[order_id]['average'] else self.executions[order_id]['price']) * self.executions[order_id]['amount'] for order_id in self.executions ])
|
|
192
|
+
average_cost = sum([ (self.executions[order_id]['average'] if 'average' in self.executions[order_id] else 0 if self.executions[order_id]['average'] else self.executions[order_id]['price']) * self.executions[order_id]['amount'] for order_id in self.executions ])
|
|
193
193
|
average_cost = average_cost / total_amount if total_amount!=0 else 0
|
|
194
194
|
return average_cost
|
|
195
195
|
|
|
196
196
|
def get_fees(self) -> float:
|
|
197
197
|
fees : float = 0
|
|
198
198
|
if self.fees_ccy:
|
|
199
|
-
fees = sum([ float(self.executions[order_id]['fee']['cost']) for order_id in self.executions if self.executions[order_id]['fee'] and self.executions[order_id]['fee']['currency'].strip().upper()==self.fees_ccy.strip().upper() ])
|
|
199
|
+
fees = sum([ float(self.executions[order_id]['fee']['cost'] if self.executions[order_id]['fee'] else 0) for order_id in self.executions if self.executions[order_id]['fee'] and self.executions[order_id]['fee']['currency'].strip().upper()==self.fees_ccy.strip().upper() ])
|
|
200
200
|
return fees
|
|
201
201
|
|
|
202
202
|
def to_dict(self) -> Dict[JSON_SERIALIZABLE_TYPES, JSON_SERIALIZABLE_TYPES]:
|
|
@@ -99,8 +99,8 @@ def compute_candles_stats(
|
|
|
99
99
|
pd_candles['candle_height_percent_rounded'] = pd_candles['candle_height_percent'].round().astype(int)
|
|
100
100
|
|
|
101
101
|
pd_candles['chop_against_ema'] = (
|
|
102
|
-
(pd_candles['is_green'] & (pd_candles['close'] > pd_candles['ema_close'])) | # Case 1: Green candle and close > EMA
|
|
103
|
-
(
|
|
102
|
+
(~pd_candles['is_green'] & (pd_candles['close'] > pd_candles['ema_close'])) | # Case 1: Green candle and close > EMA
|
|
103
|
+
(pd_candles['is_green'] & (pd_candles['close'] < pd_candles['ema_close'])) # Case 2: Red candle and close < EMA
|
|
104
104
|
)
|
|
105
105
|
|
|
106
106
|
pd_candles['ema_volume_short_periods'] = pd_candles['volume'].ewm(span=sliding_window_how_many_candles/slow_fast_interval_ratio, adjust=False).mean()
|
|
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.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/candles_ta_provider.py
RENAMED
|
File without changes
|
{siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/ccxt_candles_ta_to_csv.py
RENAMED
|
File without changes
|
|
File without changes
|
{siglab_py-0.1.29 → siglab_py-0.1.31}/siglab_py/market_data_providers/futu_candles_ta_to_csv.py
RENAMED
|
File without changes
|
{siglab_py-0.1.29 → siglab_py-0.1.31}/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
|