修改了一些东西
This commit is contained in:
+13
-11
@@ -47,7 +47,9 @@ class ChanKLC():
|
||||
self.signal = 0
|
||||
self.state = Chan_MACD_STATE.UNKNOWN
|
||||
self.continue_div = False
|
||||
self.separate_div = 0
|
||||
self.separate_div = False
|
||||
self.ema52 = klu.ema52
|
||||
self.ema24 = klu.ema24
|
||||
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):
|
||||
@@ -62,21 +64,17 @@ class ChanKLC():
|
||||
self.end_klu = klu
|
||||
self.end_time = klu.time
|
||||
self.close = klu.close
|
||||
self.cal_indicators()
|
||||
self.cal_shape_1()
|
||||
self.strength = self.cal_klc_strength()
|
||||
self.cal_bb_out()
|
||||
if self.pre:
|
||||
self.pre.cal_bb_out()
|
||||
def cal_bb_out(self):
|
||||
return
|
||||
for klu in self.klus:
|
||||
if klu.macd_state != Chan_MACD_STATE.UNKNOWN:
|
||||
self.state = klu.macd_state
|
||||
if klu.separate_div > 0:
|
||||
self.separate_div = True
|
||||
if klu.continue_div:
|
||||
self.continue_div = klu.continue_div
|
||||
if klu.macd_state != Chan_MACD_STATE.UNKNOWN:
|
||||
self.state = klu.macd_state
|
||||
self.cal_indicators()
|
||||
def cal_bb_out(self):
|
||||
return
|
||||
for klu in self.klus:
|
||||
if self.high >= klu.bbup302 and klu.bbup302 > 0 and (self.klc_fx_type == Chan_KLC_FX.TOP1 or self.klc_fx_type == Chan_KLC_FX.TOP2):
|
||||
#print(self.end_time, self.high, klu.bbup302, self.klc_fx_type)
|
||||
if self.high >= klu.bbup30 and klu.bbup30 > 0 and self.next and (self.next.macd - self.macd) < 0:
|
||||
@@ -119,10 +117,14 @@ class ChanKLC():
|
||||
self.rsi += self.klus[index].rsi
|
||||
self.volume_ratio += self.klus[index].volume_ratio
|
||||
self.macdhist += self.klus[index].macdhist
|
||||
self.ema52 += self.klus[index].ema52
|
||||
self.ema24 += self.klus[index].ema24
|
||||
self.rsi = self.rsi / len(self.klus)
|
||||
self.volume_ratio = self.volume_ratio / len(self.klus)
|
||||
self.volume = self.volume / len(self.klus)
|
||||
self.macdhist = self.macdhist / len(self.klus)
|
||||
self.ema52 = self.ema52 / len(self.klus)
|
||||
self.ema24 = self.ema24 / len(self.klus)
|
||||
if len(self.klus) > 0:
|
||||
self.macd = self.klus[-1].macd
|
||||
self.signal = self.klus[-1].signal
|
||||
|
||||
Reference in New Issue
Block a user