openfund-maker 1.0.8__py3-none-any.whl → 1.0.10__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.
@@ -359,7 +359,7 @@ class ThreeLineOrdergBot:
359
359
  'index': None
360
360
  }
361
361
 
362
- def judge_ma_apex(self,fastklines,slowklines) -> bool:
362
+ def judge_ma_apex(self,symbol, fastklines,slowklines) -> bool:
363
363
  df = pd.DataFrame()
364
364
  df['ema'] = fastklines
365
365
  df['sma'] = slowklines
@@ -368,9 +368,9 @@ class ThreeLineOrdergBot:
368
368
  # 计算斜率,【正】表示两线距离扩张,【负】表示两线距离收缩
369
369
  df['slope'] = df['diff'].abs().diff().round(6)
370
370
 
371
- #
372
- return df['slope'].iloc[-1] < 0
373
- # df['statu'] = df['slope']
371
+ self.logger.debug(f"{symbol}: slopes = {df['slope'].tail(5)} ")
372
+ # 检查最后两个斜率是否都为负
373
+ return all(slope < 0 for slope in df['slope'].tail(2))
374
374
 
375
375
 
376
376
  def calculate_range_diff(self,prices:pd.Series) -> float:
@@ -454,7 +454,7 @@ class ThreeLineOrdergBot:
454
454
  is_bearish_trend = True
455
455
 
456
456
  # 结合金叉死叉判断是否是周期顶部和底部
457
- is_apex = self.judge_ma_apex(fastklines=fastk,slowklines=slowk)
457
+ is_apex = self.judge_ma_apex(symbol=symbol,fastklines=fastk,slowklines=slowk)
458
458
  # 金叉死叉逻辑
459
459
  if last_cross_direction and last_cross_direction['cross'] == 1 : # 金叉
460
460
  self.logger.debug(f"{symbol} 金叉:{last_cross_direction},清理空单,挂多单!!")
@@ -462,17 +462,17 @@ class ThreeLineOrdergBot:
462
462
  if is_apex :
463
463
  self.logger.debug(f"{symbol} 金叉:{last_cross_direction},周期见顶 {is_apex},不开单!!")
464
464
  is_bullish_trend = False
465
- return
465
+
466
466
  elif last_cross_direction and last_cross_direction['cross'] == 0 : # 死叉
467
467
  self.logger.debug(f"{symbol} 死叉:{last_cross_direction},清理多单,挂空单!!")
468
468
  is_bullish_trend = False
469
469
  if is_apex :
470
470
  self.logger.debug(f"{symbol} 死叉:{last_cross_direction},周期见顶 {is_apex},不开单!!")
471
471
  is_bearish_trend = False
472
- return
472
+
473
473
  else:
474
474
  self.logger.debug(f"{symbol} 当前没有金叉死叉,以快线趋势为准。!")
475
- return
475
+
476
476
 
477
477
  if not is_bullish_trend and not is_bearish_trend :
478
478
  self.logger.info(f"{symbol} 当前是震荡趋势(平),不挂单!!")
@@ -546,6 +546,7 @@ class ThreeLineOrdergBot:
546
546
  symbols = list(self.trading_pairs_config.keys()) # 获取所有币对的ID
547
547
  batch_size = 5 # 每批处理的数量
548
548
  while True:
549
+
549
550
  for i in range(0, len(symbols), batch_size):
550
551
  batch = symbols[i:i + batch_size]
551
552
  with ThreadPoolExecutor(max_workers=batch_size) as executor:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openfund-maker
3
- Version: 1.0.8
3
+ Version: 1.0.10
4
4
  Summary: Openfund-maker.
5
5
  Requires-Python: >=3.9,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,4 +1,4 @@
1
- maker/ThreeLineOrderBot.py,sha256=bqJj17SQw4XVGXtgDvY-uNCIG4NAwalRjWr5OT_SQG4,23838
1
+ maker/ThreeLineOrderBot.py,sha256=pnJ8qQvsP1cksFs2FCKaenjwkhwx4ODyO2JWvhvFEqA,23941
2
2
  maker/WickReversalOrderBot.py,sha256=Oc6wChdWu39lfWh3NRHM8BqvaRIYDNZiDR6PDnE9XUM,17374
3
3
  maker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  maker/config.py,sha256=YPxghO5i0vgRg9Cja8kGj9O7pgSbbtzOgf3RexqXXwY,1188
@@ -7,7 +7,7 @@ maker/main_m.py,sha256=0PzDTnuBrxfpy5WDfsIHKAzZ_7pkuvuqqeWik0vpWio,15522
7
7
  maker/okxapi.py,sha256=_9G0U_o0ZC8NxaT6PqpiLgxBm9gPobC9PsFHZE1c5w0,553
8
8
  maker/zhen.py.bak,sha256=HNkrQbJts8G9umE9chEFsc0cLQApcM9KOVNMYPpkBXM,10918
9
9
  maker/zhen_2.py,sha256=4IaHVtTCMSlrLGSTZrWpW2q-f7HZsUNRkW_-5QgWv24,10509
10
- openfund_maker-1.0.8.dist-info/METADATA,sha256=jlncVj8iDI2oWPC2YL6Ox30K71pOUP85HIhWSB9rAws,1965
11
- openfund_maker-1.0.8.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
12
- openfund_maker-1.0.8.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
13
- openfund_maker-1.0.8.dist-info/RECORD,,
10
+ openfund_maker-1.0.10.dist-info/METADATA,sha256=9mOPJj5EQMbRwfvF8akyHekrt8f6RoHkFrEZgqqFXSI,1966
11
+ openfund_maker-1.0.10.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
12
+ openfund_maker-1.0.10.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
13
+ openfund_maker-1.0.10.dist-info/RECORD,,