change something
This commit is contained in:
+26
-8
@@ -68,13 +68,19 @@ class ChanLun():
|
||||
def check_fx(self, klc):
|
||||
if klc.pre and klc.next:
|
||||
if klc.high > klc.pre.high and klc.high > klc.next.high:
|
||||
klc.set_fx(Chan_FX_TYPE.TOP)
|
||||
#print(klc.start_time, klc.end_time,klc.next.start_time, klc.next.end_time,klc.fx, "TOP")
|
||||
return Chan_FX_TYPE.TOP
|
||||
if klc.pre.pre and klc.high > klc.pre.pre.high and klc.next.next and klc.high > klc.next.next.high:
|
||||
klc.set_fx(Chan_FX_TYPE.TOP)
|
||||
if klc.pre.pre.pre and klc.high > klc.pre.pre.pre.high and klc.next.next.next and klc.high > klc.next.next.next.high:
|
||||
klc.set_fx(Chan_FX_TYPE.TOP)
|
||||
#print(klc.start_time, klc.end_time,klc.next.start_time, klc.next.end_time,klc.fx, "TOP")
|
||||
return Chan_FX_TYPE.TOP
|
||||
elif klc.low < klc.pre.low and klc.low < klc.next.low:
|
||||
klc.set_fx(Chan_FX_TYPE.BOTTOM)
|
||||
#print(klc.start_time, klc.end_time,klc.next.start_time, klc.next.end_time,klc.fx, "BOTTOM")
|
||||
return Chan_FX_TYPE.BOTTOM
|
||||
if klc.pre.pre and klc.low < klc.pre.pre.low and klc.next.next and klc.low < klc.next.next.low:
|
||||
klc.set_fx(Chan_FX_TYPE.BOTTOM)
|
||||
if klc.pre.pre.pre and klc.low < klc.pre.pre.pre.low and klc.next.next.next and klc.low < klc.next.next.next.low:
|
||||
klc.set_fx(Chan_FX_TYPE.BOTTOM)
|
||||
#print(klc.start_time, klc.end_time,klc.next.start_time, klc.next.end_time,klc.fx, "BOTTOM")
|
||||
return Chan_FX_TYPE.BOTTOM
|
||||
return Chan_FX_TYPE.UNKNOWN
|
||||
def plot_dataframe(self, dataframe):
|
||||
klc_list = self.get_klc_list(dataframe)
|
||||
@@ -661,6 +667,8 @@ class ChanLun():
|
||||
if last_bottom and klc.high > last_bi.high:
|
||||
last_bi.set_end_klc(last_bottom, klc)
|
||||
bi = ChanBI(last_bottom, len(bi_list), Chan_BI_DIR.UP)
|
||||
#klc.set_klc_fx_type(Chan_KLC_FX.BOTTOM7)
|
||||
#klc.bb_out = True
|
||||
last_bi.set_next(bi)
|
||||
bi.set_pre(last_bi)
|
||||
for klc_index in range(last_bi.end_klc.index, len(klc_list)):
|
||||
@@ -674,6 +682,8 @@ class ChanLun():
|
||||
if last_top and klc.low < last_bi.low:
|
||||
last_bi.set_end_klc(last_top, klc)
|
||||
bi = ChanBI(last_top, len(bi_list), Chan_BI_DIR.DOWN)
|
||||
#klc.set_klc_fx_type(Chan_KLC_FX.TOP6)
|
||||
#klc.bb_out = True
|
||||
last_bi.set_next(bi)
|
||||
bi.set_pre(last_bi)
|
||||
for klc_index in range(last_bi.end_klc.index, len(klc_list)):
|
||||
@@ -694,7 +704,7 @@ class ChanLun():
|
||||
#klc.set_state("20")
|
||||
bi_list[-1].add_klc(klc)
|
||||
klc.set_bi(bi_list[-1])
|
||||
klc.set_klc_fx_type(Chan_KLC_FX.TOP3)
|
||||
#klc.set_klc_fx_type(Chan_KLC_FX.TOP3)
|
||||
klc.set_last_top_klu(last_top)
|
||||
#print(klc.start_time, klc.fx, "二类卖点Sell 1")
|
||||
else:
|
||||
@@ -748,6 +758,8 @@ class ChanLun():
|
||||
if not last_bi.is_sure:
|
||||
last_bi.set_end_klc(last_bottom, klc)
|
||||
bi = ChanBI(last_bottom, len(bi_list), Chan_BI_DIR.UP)
|
||||
#klc.set_klc_fx_type(Chan_KLC_FX.BOTTOM7)
|
||||
#klc.bb_out = True
|
||||
last_bi.set_next(bi)
|
||||
bi.set_pre(last_bi)
|
||||
bi.add_klc(klc)
|
||||
@@ -797,6 +809,8 @@ class ChanLun():
|
||||
# First temp top
|
||||
last_top = klc
|
||||
bi = ChanBI(klc, len(bi_list), Chan_BI_DIR.DOWN)
|
||||
#klc.set_klc_fx_type(Chan_KLC_FX.TOP6)
|
||||
#klc.bb_out = True
|
||||
bi_list.append(bi)
|
||||
bi_list[-1].add_klc(klc)
|
||||
klc.set_bi(bi_list[-1])
|
||||
@@ -815,7 +829,7 @@ class ChanLun():
|
||||
#klc.set_state("-20")
|
||||
bi_list[-1].add_klc(klc)
|
||||
klc.set_bi(bi_list[-1])
|
||||
klc.set_klc_fx_type(Chan_KLC_FX.BOTTOM3)
|
||||
#klc.set_klc_fx_type(Chan_KLC_FX.BOTTOM3)
|
||||
klc.set_last_bottom_klc(last_bottom)
|
||||
#print(last_bottom.start_time, last_bottom.end_time, "--------------------------------1")
|
||||
#print(klc.start_time, klc.fx, "二类买点Buy 1")
|
||||
@@ -871,6 +885,8 @@ class ChanLun():
|
||||
if not last_bi.is_sure:
|
||||
last_bi.set_end_klc(last_top, klc)
|
||||
bi = ChanBI(last_top, len(bi_list), Chan_BI_DIR.DOWN)
|
||||
#klc.set_klc_fx_type(Chan_KLC_FX.TOP6)
|
||||
#klc.bb_out = True
|
||||
last_bi.set_next(bi)
|
||||
bi.set_pre(last_bi)
|
||||
bi.add_klc(klc)
|
||||
@@ -921,6 +937,8 @@ class ChanLun():
|
||||
# First temp bottom and no top yet
|
||||
last_bottom = klc
|
||||
bi = ChanBI(klc, len(bi_list), Chan_BI_DIR.UP)
|
||||
#klc.set_klc_fx_type(Chan_KLC_FX.BOTTOM7)
|
||||
#klc.bb_out = True
|
||||
bi_list.append(bi)
|
||||
bi_list[-1].add_klc(klc)
|
||||
klc.set_bi(bi_list[-1])
|
||||
|
||||
Reference in New Issue
Block a user