CD重新定义
This commit is contained in:
+2
-2
@@ -79,12 +79,12 @@ class ChanKLC():
|
|||||||
if self.fx == Chan_FX_TYPE.TOP:
|
if self.fx == Chan_FX_TYPE.TOP:
|
||||||
#print(self.end_time, self.fx, self.macd, self.macdhist, len(self.klus))
|
#print(self.end_time, self.fx, self.macd, self.macdhist, len(self.klus))
|
||||||
if self.macdhist < 0 and self.macd > 0:
|
if self.macdhist < 0 and self.macd > 0:
|
||||||
self.klc_fx_type = Chan_KLC_FX.TOP5
|
#self.klc_fx_type = Chan_KLC_FX.TOP5
|
||||||
self.bb_out = True
|
self.bb_out = True
|
||||||
else:
|
else:
|
||||||
if self.fx == Chan_FX_TYPE.BOTTOM:
|
if self.fx == Chan_FX_TYPE.BOTTOM:
|
||||||
if self.macdhist > 0 and self.macd < 0:
|
if self.macdhist > 0 and self.macd < 0:
|
||||||
self.klc_fx_type = Chan_KLC_FX.BOTTOM5
|
#self.klc_fx_type = Chan_KLC_FX.BOTTOM5
|
||||||
self.bb_out = True
|
self.bb_out = True
|
||||||
|
|
||||||
def cal_macd_state(self, dir):
|
def cal_macd_state(self, dir):
|
||||||
|
|||||||
+6
-2
@@ -70,15 +70,19 @@ class ChanMACDHistSet():
|
|||||||
#self.div_count = 0
|
#self.div_count = 0
|
||||||
#self.peak_div_list = []
|
#self.peak_div_list = []
|
||||||
else:
|
else:
|
||||||
if klu.pre.macd * klu.pre.macdhist > 0 and klu.pre.signal * klu.pre.macdhist > 0 and abs(klu.pre.signal) > abs(klu.pre.macdhist):
|
if klu.pre.macd * klu.pre.macdhist > 0 and klu.pre.signal * klu.pre.macdhist > 0:
|
||||||
self.peak_div_list.append(klu.pre)
|
self.peak_div_list.append(klu.pre)
|
||||||
self.div_count += 1
|
self.div_count += 1
|
||||||
klu.pre.continue_div = True
|
|
||||||
else:
|
else:
|
||||||
self.peak_klu = klu.pre
|
self.peak_klu = klu.pre
|
||||||
def set_end_klu(self, end_klu):
|
def set_end_klu(self, end_klu):
|
||||||
self.end_klu = end_klu
|
self.end_klu = end_klu
|
||||||
self.end_time = end_klu.time
|
self.end_time = end_klu.time
|
||||||
|
if len(self.peak_div_list) > 0:
|
||||||
|
klu = self.peak_div_list[-1]
|
||||||
|
if klu.macd * klu.macdhist > 0:
|
||||||
|
end_klu.continue_div = True
|
||||||
|
print(end_klu.time, "Continue Div")
|
||||||
if self.start_klu.index == end_klu.index:
|
if self.start_klu.index == end_klu.index:
|
||||||
self.peak_klu = self.start_klu
|
self.peak_klu = self.start_klu
|
||||||
if self.start_klu.index + 1 == end_klu.index:
|
if self.start_klu.index + 1 == end_klu.index:
|
||||||
|
|||||||
Reference in New Issue
Block a user