继续bb
This commit is contained in:
+10
-4
@@ -50,6 +50,7 @@ class ChanKLC():
|
||||
def set_klc_fx_type(self, klc_fx_type):
|
||||
#print(self.start_time, klc_fx_type, self.get_feature_data()['klu_macd'], self.get_feature_data()['klu_macdhist'], self.get_feature_data()['klu_rsi'])
|
||||
self.klc_fx_type = klc_fx_type
|
||||
self.cal_bb_out()
|
||||
def add_klu(self, klu):
|
||||
self.klus.append(klu)
|
||||
def set_end_klu(self, klu):
|
||||
@@ -60,14 +61,19 @@ class ChanKLC():
|
||||
self.cal_shape_1()
|
||||
self.strength = self.cal_klc_strength()
|
||||
self.cal_bb_out()
|
||||
if self.pre:
|
||||
self.pre.cal_bb_out()
|
||||
#self.bb_out = True
|
||||
def cal_bb_out(self):
|
||||
for klu in self.klus:
|
||||
if self.high >= klu.bbup30 and klu.bbup30 > 0:
|
||||
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):
|
||||
self.bb_out = True
|
||||
break
|
||||
if self.low <= klu.bblow30 and klu.bblow30 > 0:
|
||||
if self.high >= klu.bbup30 and klu.bbup30 > 0:
|
||||
self.klc_fx_type = Chan_KLC_FX.TOP4
|
||||
if self.low <= klu.bblow302 and klu.bblow302 > 0 and (self.klc_fx_type == Chan_KLC_FX.BOTTOM1 or self.klc_fx_type == Chan_KLC_FX.BOTTOM2):
|
||||
self.bb_out = True
|
||||
break
|
||||
if self.low <= klu.bblow30 and klu.bblow30 > 0:
|
||||
self.klc_fx_type = Chan_KLC_FX.BOTTOM4
|
||||
def cal_indicators(self):
|
||||
for index in range(1, len(self.klus)):
|
||||
self.volume += self.klus[index].volume
|
||||
|
||||
Reference in New Issue
Block a user