add bb bb

This commit is contained in:
jackyu66git
2025-07-08 02:25:23 +08:00
parent 9a68aa1913
commit d60805487d
5 changed files with 69 additions and 49 deletions
+10
View File
@@ -42,6 +42,7 @@ class ChanKLC():
self.strength = klu.strength
self.last_top_klc = None
self.last_bottom_klc = None
self.bb_out = False
def set_last_top_klu(self, last_top_klc):
self.last_top_klc = last_top_klc
def set_last_bottom_klc(self, last_bottom_klc):
@@ -58,6 +59,15 @@ class ChanKLC():
self.cal_indicators()
self.cal_shape_1()
self.strength = self.cal_klc_strength()
self.cal_bb_out()
def cal_bb_out(self):
for klu in self.klus:
if self.high >= klu.bbup30 and klu.bbup30 > 0:
self.bb_out = True
break
if self.low <= klu.bblow30 and klu.bblow30 > 0:
self.bb_out = True
break
def cal_indicators(self):
for index in range(1, len(self.klus)):
self.volume += self.klus[index].volume