siglab-py 0.1.13__py3-none-any.whl → 0.1.16__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.
- siglab_py/ordergateway/client.py +2 -0
- siglab_py/ordergateway/gateway.py +7 -2
- {siglab_py-0.1.13.dist-info → siglab_py-0.1.16.dist-info}/METADATA +1 -1
- {siglab_py-0.1.13.dist-info → siglab_py-0.1.16.dist-info}/RECORD +6 -6
- {siglab_py-0.1.13.dist-info → siglab_py-0.1.16.dist-info}/WHEEL +0 -0
- {siglab_py-0.1.13.dist-info → siglab_py-0.1.16.dist-info}/top_level.txt +0 -0
siglab_py/ordergateway/client.py
CHANGED
|
@@ -133,6 +133,8 @@ class DivisiblePosition(Order):
|
|
|
133
133
|
def get_filled_amount(self) -> float:
|
|
134
134
|
# filled_amount is in base ccy
|
|
135
135
|
filled_amount = sum([ self.executions[order_id]['filled'] * self.multiplier for order_id in self.executions ])
|
|
136
|
+
if self.side=='sell':
|
|
137
|
+
filled_amount = -1 * filled_amount
|
|
136
138
|
return filled_amount
|
|
137
139
|
|
|
138
140
|
def get_average_cost(self) -> float:
|
|
@@ -483,6 +483,9 @@ async def execute_one_position(
|
|
|
483
483
|
rounded_limit_price : float = exchange.price_to_precision(position.ticker, limit_price) # type: ignore
|
|
484
484
|
rounded_limit_price = float(rounded_limit_price)
|
|
485
485
|
|
|
486
|
+
order_params = {
|
|
487
|
+
'reduceOnly': slice.reduce_only
|
|
488
|
+
}
|
|
486
489
|
if position.order_type=='limit':
|
|
487
490
|
if not param['dry_run']:
|
|
488
491
|
executed_order = await exchange.create_order( # type: ignore
|
|
@@ -490,7 +493,8 @@ async def execute_one_position(
|
|
|
490
493
|
type = position.order_type,
|
|
491
494
|
amount = rounded_slice_amount_in_base_ccy,
|
|
492
495
|
price = rounded_limit_price,
|
|
493
|
-
side = position.side
|
|
496
|
+
side = position.side,
|
|
497
|
+
params = order_params
|
|
494
498
|
)
|
|
495
499
|
else:
|
|
496
500
|
executed_order = DUMMY_EXECUTION.copy()
|
|
@@ -515,7 +519,8 @@ async def execute_one_position(
|
|
|
515
519
|
symbol = position.ticker,
|
|
516
520
|
type = position.order_type,
|
|
517
521
|
amount = rounded_slice_amount_in_base_ccy,
|
|
518
|
-
side = position.side
|
|
522
|
+
side = position.side,
|
|
523
|
+
params = order_params
|
|
519
524
|
)
|
|
520
525
|
else:
|
|
521
526
|
executed_order = DUMMY_EXECUTION.copy()
|
|
@@ -10,9 +10,9 @@ siglab_py/market_data_providers/deribit_options_expiry_provider.py,sha256=e9Ee8T
|
|
|
10
10
|
siglab_py/market_data_providers/orderbooks_provider.py,sha256=olt-3LIkoyzQWfNNQRhJtKibLbkTutt_q_rCCTM7i1g,16216
|
|
11
11
|
siglab_py/market_data_providers/test_provider.py,sha256=wBLCgcWjs7FGZJXWsNyn30lkOLa_cgpuvqRakMC0wbA,2221
|
|
12
12
|
siglab_py/ordergateway/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
siglab_py/ordergateway/client.py,sha256=
|
|
13
|
+
siglab_py/ordergateway/client.py,sha256=9_AzWE600lXxHEiYGGGT7Vf3zNNhRhsqq92zVlexbNY,9336
|
|
14
14
|
siglab_py/ordergateway/encrypt_keys_util.py,sha256=-qi87db8To8Yf1WS1Q_Cp2Ya7ZqgWlRqSHfNXCM7wE4,1339
|
|
15
|
-
siglab_py/ordergateway/gateway.py,sha256=
|
|
15
|
+
siglab_py/ordergateway/gateway.py,sha256=CugCtEI-ShxjRr_DkLbasOmZ1O1iUmSTu1FzPVN8evs,36937
|
|
16
16
|
siglab_py/ordergateway/test_ordergateway.py,sha256=_Gz2U_VqljogGWqGyNDYYls1INqUiig9veyPttfGRpg,3901
|
|
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
|
|
@@ -24,7 +24,7 @@ siglab_py/util/analytic_util.py,sha256=QLabbEMqM4rKKH2PE_LqxIyo-BUdCRhkLybLATBIm
|
|
|
24
24
|
siglab_py/util/aws_util.py,sha256=KGmjHrr1rpnnxr33nXHNzTul4tvyyxl9p6gpwNv0Ygc,2557
|
|
25
25
|
siglab_py/util/market_data_util.py,sha256=3qTq71xGvQXj0ORKJV50IN5FP_mCBF_gvdmlPyhdyco,16439
|
|
26
26
|
siglab_py/util/retry_util.py,sha256=mxYuRFZRZoaQQjENcwPmxhxixtd1TFvbxIdPx4RwfRc,743
|
|
27
|
-
siglab_py-0.1.
|
|
28
|
-
siglab_py-0.1.
|
|
29
|
-
siglab_py-0.1.
|
|
30
|
-
siglab_py-0.1.
|
|
27
|
+
siglab_py-0.1.16.dist-info/METADATA,sha256=JvrZdBgqlToTwoXCfKkDTCvHLGWJaY9r8qSqwuAo2o0,1097
|
|
28
|
+
siglab_py-0.1.16.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
29
|
+
siglab_py-0.1.16.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
|
|
30
|
+
siglab_py-0.1.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|