openfund-taker 1.3.5__py3-none-any.whl → 1.3.6__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.
- {openfund_taker-1.3.5.dist-info → openfund_taker-1.3.6.dist-info}/METADATA +1 -1
- {openfund_taker-1.3.5.dist-info → openfund_taker-1.3.6.dist-info}/RECORD +5 -5
- taker/TrailingSLTaker.py +10 -6
- {openfund_taker-1.3.5.dist-info → openfund_taker-1.3.6.dist-info}/WHEEL +0 -0
- {openfund_taker-1.3.5.dist-info → openfund_taker-1.3.6.dist-info}/entry_points.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
taker/MultiAssetOldTradingBot.py,sha256=uBh_BxglvcbaHIsWHM7GI9Qa_QjzsxXaXJAAWEOMO5c,15315
|
2
2
|
taker/ThreeLineTradingTaker.py,sha256=ElD9pKDO4nxw5VKNRrvXqyiU0gkV_1Mg_zk-hftfaPs,20553
|
3
3
|
taker/TrailingSLAndTPTaker.py,sha256=rx3tw9TwFCpqnz3e0WlTtFVcn8mBbPHtp62n3RF86Kg,1144
|
4
|
-
taker/TrailingSLTaker.py,sha256=
|
4
|
+
taker/TrailingSLTaker.py,sha256=cU_rI_uI0XFmuDNMW_i5DmI-5EA5NCe-mLVNhthxa1E,42792
|
5
5
|
taker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
taker/chua_bitget.py,sha256=YY6XK5Bd-wlArsN5BnAfiqE0h1DPkti6i4TEB4F5zDA,12918
|
7
7
|
taker/chua_bn.py,sha256=GnTePWlgDwdHgroBbEp1Ajcsf5_m_Vn_RV63SYzu2jI,10668
|
@@ -10,7 +10,7 @@ taker/chua_ok_all.py,sha256=2XnZM6QdB3juSE1pqQIJyh2x1XuhlTlnBKNA3owlJ9E,15267
|
|
10
10
|
taker/chua_ok_bot.py,sha256=9SW0ujhi6PfN4yR1JZ9NaA37HtnXJ2QAWUfW52NG68w,13109
|
11
11
|
taker/config.py,sha256=YPxghO5i0vgRg9Cja8kGj9O7pgSbbtzOgf3RexqXXwY,1188
|
12
12
|
taker/main.py,sha256=QCEjINu3IgwWEGcuquHzeYjKJYAQrPe8ctQhMoIb9SA,2561
|
13
|
-
openfund_taker-1.3.
|
14
|
-
openfund_taker-1.3.
|
15
|
-
openfund_taker-1.3.
|
16
|
-
openfund_taker-1.3.
|
13
|
+
openfund_taker-1.3.6.dist-info/METADATA,sha256=pBXaqV1kuyWEln1QYZY-H86Z790pmXHVegRHvhlbhW4,7527
|
14
|
+
openfund_taker-1.3.6.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
15
|
+
openfund_taker-1.3.6.dist-info/entry_points.txt,sha256=a7mG8F7aOA5-Gk2vPWuAR4537faxaHUgM_jwIDBZoEc,50
|
16
|
+
openfund_taker-1.3.6.dist-info/RECORD,,
|
taker/TrailingSLTaker.py
CHANGED
@@ -513,7 +513,7 @@ class TrailingSLTaker:
|
|
513
513
|
|
514
514
|
|
515
515
|
|
516
|
-
def set_stop_loss(self, symbol, position, stop_loss_price=None) -> bool:
|
516
|
+
def set_stop_loss(self, symbol, position, stop_loss_price=None , ord_type='market') -> bool:
|
517
517
|
|
518
518
|
# 计算下单数量
|
519
519
|
amount = abs(float(position['contracts']))
|
@@ -528,11 +528,12 @@ class TrailingSLTaker:
|
|
528
528
|
|
529
529
|
# 止损单逻辑
|
530
530
|
adjusted_price = self.round_price_to_tick(symbol, stop_loss_price)
|
531
|
-
|
531
|
+
|
532
|
+
# 默认市价止损,委托价格为-1时,执行市价止损。
|
532
533
|
sl_params = {
|
533
534
|
'slTriggerPx':adjusted_price ,
|
534
|
-
|
535
|
-
'slOrdPx' : adjusted_price,
|
535
|
+
'slOrdPx':'-1', # 委托价格为-1时,执行市价止损
|
536
|
+
# 'slOrdPx' : adjusted_price,
|
536
537
|
'slTriggerPxType':'last',
|
537
538
|
'tdMode':position['marginMode'],
|
538
539
|
'sz': str(amount),
|
@@ -540,6 +541,8 @@ class TrailingSLTaker:
|
|
540
541
|
'cxlOnClosePos': True,
|
541
542
|
'reduceOnly':True
|
542
543
|
}
|
544
|
+
if ord_type == 'limit':
|
545
|
+
sl_params['slOrdPx'] = adjusted_price
|
543
546
|
|
544
547
|
side = 'short'
|
545
548
|
if position['side'] == side: # 和持仓反向相反下单
|
@@ -557,8 +560,8 @@ class TrailingSLTaker:
|
|
557
560
|
|
558
561
|
self.exchange.create_order(
|
559
562
|
symbol=symbol,
|
560
|
-
type='optimal_limit_ioc',
|
561
|
-
|
563
|
+
# type='optimal_limit_ioc',
|
564
|
+
type='conditional',
|
562
565
|
# type='limit',
|
563
566
|
price=adjusted_price,
|
564
567
|
side=orderSide,
|
@@ -566,6 +569,7 @@ class TrailingSLTaker:
|
|
566
569
|
params=sl_params
|
567
570
|
)
|
568
571
|
self.logger.info(f"{symbol}: SL at {adjusted_price} Done.")
|
572
|
+
|
569
573
|
break
|
570
574
|
|
571
575
|
|
File without changes
|
File without changes
|