siglab-py 0.1.16__tar.gz → 0.1.17__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.16 → siglab_py-0.1.17}/PKG-INFO +1 -1
- {siglab_py-0.1.16 → siglab_py-0.1.17}/pyproject.toml +1 -1
- {siglab_py-0.1.16 → siglab_py-0.1.17}/setup.cfg +1 -1
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/ordergateway/client.py +8 -1
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py.egg-info/PKG-INFO +1 -1
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/__init__.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/constants.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/exchanges/__init__.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/exchanges/any_exchange.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/market_data_providers/__init__.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/market_data_providers/aggregated_orderbook_provider.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/market_data_providers/candles_provider.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/market_data_providers/candles_ta_provider.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/market_data_providers/deribit_options_expiry_provider.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/market_data_providers/orderbooks_provider.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/market_data_providers/test_provider.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/ordergateway/__init__.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/ordergateway/encrypt_keys_util.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/ordergateway/gateway.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/ordergateway/test_ordergateway.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/tests/__init__.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/tests/integration/__init__.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/tests/integration/market_data_util_tests.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/tests/unit/__init__.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/tests/unit/analytic_util_tests.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/util/__init__.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/util/analytic_util.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/util/aws_util.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/util/market_data_util.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py/util/retry_util.py +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py.egg-info/SOURCES.txt +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py.egg-info/dependency_links.txt +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/siglab_py.egg-info/requires.txt +0 -0
- {siglab_py-0.1.16 → siglab_py-0.1.17}/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.17"
|
|
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"}
|
|
@@ -35,6 +35,9 @@ class Order:
|
|
|
35
35
|
reduce_only : bool = False,
|
|
36
36
|
fees_ccy : Union[str, None] = None
|
|
37
37
|
) -> None:
|
|
38
|
+
if amount<=0:
|
|
39
|
+
raise ValueError(f"amount must be >0!")
|
|
40
|
+
|
|
38
41
|
self.ticker = ticker
|
|
39
42
|
self.side = side.strip().lower()
|
|
40
43
|
self.amount = amount
|
|
@@ -71,6 +74,9 @@ class DivisiblePosition(Order):
|
|
|
71
74
|
slices : int = 1,
|
|
72
75
|
wait_fill_threshold_ms : float = -1
|
|
73
76
|
) -> None:
|
|
77
|
+
if amount<=0:
|
|
78
|
+
raise ValueError(f"amount must be >0!")
|
|
79
|
+
|
|
74
80
|
super().__init__(ticker, side, amount, order_type, leg_room_bps, reduce_only, fees_ccy)
|
|
75
81
|
self.slices = slices
|
|
76
82
|
self.wait_fill_threshold_ms = wait_fill_threshold_ms
|
|
@@ -182,8 +188,9 @@ class DivisiblePosition(Order):
|
|
|
182
188
|
'stopLossPrice': None
|
|
183
189
|
}
|
|
184
190
|
'''
|
|
191
|
+
total_amount : float = sum([ self.executions[order_id]['amount'] for order_id in self.executions ])
|
|
185
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 ])
|
|
186
|
-
average_cost = average_cost /
|
|
193
|
+
average_cost = average_cost / total_amount if total_amount!=0 else 0
|
|
187
194
|
return average_cost
|
|
188
195
|
|
|
189
196
|
def get_fees(self) -> float:
|
|
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.16 → siglab_py-0.1.17}/siglab_py/market_data_providers/candles_ta_provider.py
RENAMED
|
File without changes
|
|
File without changes
|
{siglab_py-0.1.16 → siglab_py-0.1.17}/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
|