openfund-maker 1.0.9__py3-none-any.whl → 1.0.11__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,7 +368,10 @@ class ThreeLineOrdergBot:
368
368
  # 计算斜率,【正】表示两线距离扩张,【负】表示两线距离收缩
369
369
  df['slope'] = df['diff'].abs().diff().round(6)
370
370
 
371
+ self.logger.debug(f"{symbol}: slopes = {df['slope'].iloc[-6:-1]} ")
371
372
  # 检查最后两个斜率是否都为负
373
+ # 取slopes最新的第2个和第3个值进行判断
374
+ return all(slope < 0 for slope in df['slope'].iloc[-3:-1])
372
375
  return all(slope < 0 for slope in df['slope'].tail(2))
373
376
 
374
377
 
@@ -453,7 +456,7 @@ class ThreeLineOrdergBot:
453
456
  is_bearish_trend = True
454
457
 
455
458
  # 结合金叉死叉判断是否是周期顶部和底部
456
- is_apex = self.judge_ma_apex(fastklines=fastk,slowklines=slowk)
459
+ is_apex = self.judge_ma_apex(symbol=symbol,fastklines=fastk,slowklines=slowk)
457
460
  # 金叉死叉逻辑
458
461
  if last_cross_direction and last_cross_direction['cross'] == 1 : # 金叉
459
462
  self.logger.debug(f"{symbol} 金叉:{last_cross_direction},清理空单,挂多单!!")
@@ -545,6 +548,7 @@ class ThreeLineOrdergBot:
545
548
  symbols = list(self.trading_pairs_config.keys()) # 获取所有币对的ID
546
549
  batch_size = 5 # 每批处理的数量
547
550
  while True:
551
+
548
552
  for i in range(0, len(symbols), batch_size):
549
553
  batch = symbols[i:i + batch_size]
550
554
  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.9
3
+ Version: 1.0.11
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=9kj-84oqBlgsfTDm1LdFn3Y4JJ5UmhAVGHMCwY0VIdg,23846
1
+ maker/ThreeLineOrderBot.py,sha256=xNckEErdT6O-Yz80akLpHQnO8FSdxWep12o3w1j2FLw,24073
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.9.dist-info/METADATA,sha256=2H8RDwdZY6LHayvt139dSj4YoMuz00a5NhnkU6lb5Fw,1965
11
- openfund_maker-1.0.9.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
12
- openfund_maker-1.0.9.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
13
- openfund_maker-1.0.9.dist-info/RECORD,,
10
+ openfund_maker-1.0.11.dist-info/METADATA,sha256=bhNzNGW-n-WBwIydo9WUECHF-OZVJXBSgMbojqW5VcY,1966
11
+ openfund_maker-1.0.11.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
12
+ openfund_maker-1.0.11.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
13
+ openfund_maker-1.0.11.dist-info/RECORD,,