openfund-taker 2.1.7__py3-none-any.whl → 2.1.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openfund-taker
3
- Version: 2.1.7
3
+ Version: 2.1.9
4
4
  Summary: Openfund-taker
5
5
  Requires-Python: >=3.9,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,5 +1,5 @@
1
1
  taker/MultiAssetOldTradingBot.py,sha256=uBh_BxglvcbaHIsWHM7GI9Qa_QjzsxXaXJAAWEOMO5c,15315
2
- taker/SMCSLAndTPTaker.py,sha256=ad8C94XKiJOdQxZw1vj7RI4iZhjwJ-CWkcpTWx6tRPY,21055
2
+ taker/SMCSLAndTPTaker.py,sha256=MILrlvaQUje9Xnczi2rXszhk2XFUzeowJ_YBP4S9gNA,21241
3
3
  taker/ThreeLineTradingTaker.py,sha256=ElD9pKDO4nxw5VKNRrvXqyiU0gkV_1Mg_zk-hftfaPs,20553
4
4
  taker/TrailingSLAndTPTaker.py,sha256=OPD1ZNqyM8jZ7Im-bWm_6Cu4_qfwKmNZ30XpbP6-l00,2746
5
5
  taker/TrailingSLTaker.py,sha256=dvKZ9x-uIq3hWuV_K_gpeDhdtoA99gk15X6z2xaPmbQ,47386
@@ -11,7 +11,7 @@ taker/chua_ok_all.py,sha256=2XnZM6QdB3juSE1pqQIJyh2x1XuhlTlnBKNA3owlJ9E,15267
11
11
  taker/chua_ok_bot.py,sha256=9SW0ujhi6PfN4yR1JZ9NaA37HtnXJ2QAWUfW52NG68w,13109
12
12
  taker/config.py,sha256=YPxghO5i0vgRg9Cja8kGj9O7pgSbbtzOgf3RexqXXwY,1188
13
13
  taker/main.py,sha256=Ulz22BV34Mp8ugh-Dior1mIS8n8si8bMi5RCBit2G4U,2774
14
- openfund_taker-2.1.7.dist-info/METADATA,sha256=mboP0VeFfymJEMWSA0v_xZKrGO1TsWWb4TsewpgUtrY,7527
15
- openfund_taker-2.1.7.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
16
- openfund_taker-2.1.7.dist-info/entry_points.txt,sha256=a7mG8F7aOA5-Gk2vPWuAR4537faxaHUgM_jwIDBZoEc,50
17
- openfund_taker-2.1.7.dist-info/RECORD,,
14
+ openfund_taker-2.1.9.dist-info/METADATA,sha256=wsQHhUjl1DhC3zKn_1HEmhtZwv7K02Gp3RF1uqbND84,7527
15
+ openfund_taker-2.1.9.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
16
+ openfund_taker-2.1.9.dist-info/entry_points.txt,sha256=a7mG8F7aOA5-Gk2vPWuAR4537faxaHUgM_jwIDBZoEc,50
17
+ openfund_taker-2.1.9.dist-info/RECORD,,
taker/SMCSLAndTPTaker.py CHANGED
@@ -10,6 +10,7 @@ class SMCSLAndTPTaker(TrailingSLTaker):
10
10
  self.global_symbol_take_profit_price = {} # 记录每个symbol的止盈价格
11
11
  self.htf_liquidities = {}
12
12
  self.all_TP_SL_ratio = float(platform_config.get("all_TP_SL_ratio",1.5)) #The profit-loss ratio 盈亏比
13
+ self.open_trail_profit = bool(platform_config.get("open_trail_profit",True)) # 开仓是否设置止盈
13
14
 
14
15
  @override
15
16
  def check_reverse_position(self,symbol,position,pair_config):
@@ -219,13 +220,13 @@ class SMCSLAndTPTaker(TrailingSLTaker):
219
220
  current_tier = '无'
220
221
  # 各档止盈逻辑
221
222
  # 确定当前盈利档位
222
- if total_profit >= self.second_trail_profit_threshold:
223
+ if self.open_trail_profit and total_profit >= self.second_trail_profit_threshold:
223
224
  current_tier = "高档"
224
225
 
225
- elif total_profit>= self.first_trail_profit_threshold:
226
+ elif self.open_trail_profit and total_profit>= self.first_trail_profit_threshold:
226
227
  current_tier = "中档"
227
228
 
228
- elif total_profit >= self.low_trail_profit_threshold:
229
+ elif self.open_trail_profit and total_profit >= self.low_trail_profit_threshold:
229
230
  current_tier = "低档"
230
231
 
231
232
  # 根据不同档位设置止损价格,没有单独为交易对设置,用全局参数代替
@@ -364,7 +365,7 @@ class SMCSLAndTPTaker(TrailingSLTaker):
364
365
 
365
366
  # sl_price = self.global_symbol_stop_loss_price.get(symbol, float(position['markPrice']))
366
367
  entry_price = float(position['entryPrice'])
367
- sl_price = self.calculate_sl_price_by_pct(symbol, position['side'], stop_loss_pct)
368
+ sl_price = self.calculate_sl_price_by_pct(symbol, position, stop_loss_pct)
368
369
  threshold = 0.0
369
370
  if is_buy and sl_price > 0 :
370
371
  threshold = float(self.round_price_to_tick(symbol, (entry_price - sl_price ) * tp_sl_ratio + entry_price))
@@ -414,7 +415,7 @@ class SMCSLAndTPTaker(TrailingSLTaker):
414
415
  """
415
416
  # 如果已经触发过全局止盈,则跳过
416
417
  if self.global_symbol_take_profit_flag.get(symbol, False):
417
- self.logger.info(f"{symbol}: 已经设置过全局止盈 tp_price={self.global_symbol_take_profit_price[symbol]}")
418
+ self.logger.info(f"{symbol} : 已经设置过全局止盈 tp_price={self.global_symbol_take_profit_price[symbol]}")
418
419
  return
419
420
 
420
421
  smc_strategy = pair_config.get('smc_strategy',{})