Add klc and klu fx strength check
This commit is contained in:
+8
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user