添加k线动能理论第一部分

This commit is contained in:
jackyu66git
2025-07-25 01:22:53 +08:00
parent 15773ac457
commit b843e30ed8
4 changed files with 19 additions and 8 deletions
+12 -1
View File
@@ -43,6 +43,8 @@ class ChanKLC():
self.last_top_klc = None
self.last_bottom_klc = None
self.bb_out = False
self.macd = 0
self.signal = 0
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):
@@ -75,7 +77,13 @@ class ChanKLC():
self.bb_out = True
if self.low <= klu.bblow30 and klu.bblow30 > 0:
self.klc_fx_type = Chan_KLC_FX.BOTTOM4
#self.bb_out = True
if self.fx ==Chan_FX_TYPE.TOP:
if self.macd > 0:
self.bb_out = True
else:
if self.fx == Chan_FX_TYPE.BOTTOM:
if self.macd < 0:
self.bb_out = True
def cal_indicators(self):
for index in range(1, len(self.klus)):
self.volume += self.klus[index].volume
@@ -86,6 +94,9 @@ 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)
if len(self.klus) > 0:
self.macd = self.klus[-1].macd
self.signal = self.klus[-1].signal
def cal_shape_1(self):
for index in range(1, len(self.klus)):
self.body += self.klus[index].body