openfund-taker 1.1.5__py3-none-any.whl → 1.2.2__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.1.5.dist-info → openfund_taker-1.2.2.dist-info}/METADATA +1 -1
- {openfund_taker-1.1.5.dist-info → openfund_taker-1.2.2.dist-info}/RECORD +5 -5
- taker/MultiAssetNewTradingBot.py +10 -3
- {openfund_taker-1.1.5.dist-info → openfund_taker-1.2.2.dist-info}/WHEEL +0 -0
- {openfund_taker-1.1.5.dist-info → openfund_taker-1.2.2.dist-info}/entry_points.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
taker/MultiAssetNewTradingBot.py,sha256=
|
1
|
+
taker/MultiAssetNewTradingBot.py,sha256=TJGkAvuEgQv8AnaC3wmhAE9G9R6gJgXc1o4vtLplusQ,37564
|
2
2
|
taker/MultiAssetOldTradingBot.py,sha256=uBh_BxglvcbaHIsWHM7GI9Qa_QjzsxXaXJAAWEOMO5c,15315
|
3
3
|
taker/ThreeLineTradingBot.py,sha256=oXIoQ8z9AzKzk0z13d0ufj2KGBOk5iHJTJNZQRDKA5U,20625
|
4
4
|
taker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -9,7 +9,7 @@ taker/chua_ok_all.py,sha256=2XnZM6QdB3juSE1pqQIJyh2x1XuhlTlnBKNA3owlJ9E,15267
|
|
9
9
|
taker/chua_ok_bot.py,sha256=9SW0ujhi6PfN4yR1JZ9NaA37HtnXJ2QAWUfW52NG68w,13109
|
10
10
|
taker/config.py,sha256=YPxghO5i0vgRg9Cja8kGj9O7pgSbbtzOgf3RexqXXwY,1188
|
11
11
|
taker/main.py,sha256=8cLWzEvQDeELbY5Av7JqkEyYbaNqSbAbVl1tQHXzU8s,1954
|
12
|
-
openfund_taker-1.
|
13
|
-
openfund_taker-1.
|
14
|
-
openfund_taker-1.
|
15
|
-
openfund_taker-1.
|
12
|
+
openfund_taker-1.2.2.dist-info/METADATA,sha256=5L9h4JzuVYsPGByxHS0Cufwgn6tikgrBDKO28egKMW8,7502
|
13
|
+
openfund_taker-1.2.2.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
14
|
+
openfund_taker-1.2.2.dist-info/entry_points.txt,sha256=a7mG8F7aOA5-Gk2vPWuAR4537faxaHUgM_jwIDBZoEc,50
|
15
|
+
openfund_taker-1.2.2.dist-info/RECORD,,
|
taker/MultiAssetNewTradingBot.py
CHANGED
@@ -231,7 +231,8 @@ class MultiAssetNewTradingBot:
|
|
231
231
|
def check_reverse_position(self,symbol,position,pair_config):
|
232
232
|
side = position['side']
|
233
233
|
try:
|
234
|
-
|
234
|
+
klines_period = str(pair_config.get('klines_period', '1m'))
|
235
|
+
klines = self.get_historical_klines(symbol=symbol,bar=klines_period)
|
235
236
|
|
236
237
|
# 计算 快线EMA & 慢线SMA
|
237
238
|
ema_length = pair_config.get('ema', 15)
|
@@ -417,7 +418,7 @@ class MultiAssetNewTradingBot:
|
|
417
418
|
'slTriggerPx':adjusted_price ,
|
418
419
|
# 'slOrdPx':'-1', # 委托价格为-1时,执行市价止损
|
419
420
|
'slOrdPx' : adjusted_price,
|
420
|
-
'slTriggerPxType':'
|
421
|
+
'slTriggerPxType':'last',
|
421
422
|
'tdMode':position['marginMode'],
|
422
423
|
'sz': str(amount),
|
423
424
|
# 'closeFraction': '1',
|
@@ -482,7 +483,7 @@ class MultiAssetNewTradingBot:
|
|
482
483
|
"""
|
483
484
|
# 如果已经触发过全局止损并且有止损单,则跳过
|
484
485
|
if self.global_symbol_stop_loss_flag.get(symbol, False):
|
485
|
-
|
486
|
+
|
486
487
|
return
|
487
488
|
else :
|
488
489
|
self.logger.debug(f"{symbol} - 是否设置过全局止损 {self.global_symbol_stop_loss_flag.get(symbol, False)} ")
|
@@ -497,6 +498,12 @@ class MultiAssetNewTradingBot:
|
|
497
498
|
stop_loss_price = position['entryPrice'] * (1 + stop_loss_pct/100)
|
498
499
|
|
499
500
|
order_price = float(self.round_price_to_tick(symbol, stop_loss_price))
|
501
|
+
|
502
|
+
last_take_profit_price= self.global_symbol_take_profit_price.get(symbol,None)
|
503
|
+
if last_take_profit_price is not None and last_take_profit_price == order_price:
|
504
|
+
self.global_symbol_stop_loss_flag[symbol] = True
|
505
|
+
self.logger.debug(f"{symbol} - {side} 全局止损价没变化: {last_take_profit_price} = {order_price}")
|
506
|
+
return
|
500
507
|
|
501
508
|
try:
|
502
509
|
# 设置止损单
|
File without changes
|
File without changes
|