Add klc and klu fx strength check

This commit is contained in:
jackyu66git
2025-05-28 19:45:08 +08:00
parent 0754b5ae59
commit 843534a039
13 changed files with 885 additions and 25 deletions
+8 -2
View File
@@ -49,7 +49,13 @@ class ChanKLC():
self.volume_ratio = self.volume_ratio / len(self.klus)
self.volume = self.volume / len(self.klus)
self.macdhist = self.macdhist / len(self.klus)
def contain_klu_fx(self):
if len(self.klus) > 0:
for klu in self.klus:
klu.update_realtime_analysis()
if klu.fx_type == self.fx and klu.fx_strength > 1.8:
return True
return False
def set_next(self, klc):
self.next = klc
def set_pre(self, klc):
@@ -1221,7 +1227,7 @@ class ChanKLC():
# 获取分型后的几根K线数据
subsequent_klcs = []
temp = self.next
for i in range(5): # 检查后续5根K线
for i in range(2): # 检查后续5根K线
if temp:
subsequent_klcs.append(temp)
temp = temp.next if hasattr(temp, 'next') else None