添加识别klc_state,macd参数调整
macd调整为26,52 顶底之间间隔7个klc
This commit is contained in:
@@ -137,32 +137,24 @@ class TF_DF():
|
||||
klc_index = len(klc_list) - 1
|
||||
klc = klc_list[klc_index]
|
||||
if klc.end_klu and klc.end_klu.idx == index:
|
||||
if klc.klc_fx_type == Chan_KLC_FX.TOP1 or klc.klc_fx_type == Chan_KLC_FX.TOP2:
|
||||
if klc.klc_state == Chan_KLC_STATE.S10:
|
||||
klu_state_list.append("10")
|
||||
#print(klc.end_time, klc.klc_fx_type)
|
||||
elif klc.klc_fx_type == Chan_KLC_FX.BOTTOM1 or klc.klc_fx_type == Chan_KLC_FX.BOTTOM2:
|
||||
elif klc.klc_state == Chan_KLC_STATE.S_10:
|
||||
klu_state_list.append("-10")
|
||||
#print(klc.end_time, klc.klc_fx_type)
|
||||
elif klc.klc_state == Chan_KLC_STATE.S11:
|
||||
klu_state_list.append("11")
|
||||
#print(klc.end_time, klc.klc_fx_type)
|
||||
elif klc.klc_state == Chan_KLC_STATE.S_11:
|
||||
klu_state_list.append("-11")
|
||||
#print(klc.end_time, klc.klc_fx_type)
|
||||
else:
|
||||
if klc.continue_div:
|
||||
if klc.macdhist > 0:
|
||||
klu_state_list.append("20")
|
||||
#print(klc.end_time, "CD", 20)
|
||||
else:
|
||||
klu_state_list.append("-20")
|
||||
#print(klc.end_time, "CD", -20)
|
||||
elif klc.separate_div:
|
||||
if klc.macdhist > 0:
|
||||
klu_state_list.append("30")
|
||||
#print(klc.end_time, "SD", 30)
|
||||
else:
|
||||
klu_state_list.append("-30")
|
||||
#print(klc.end_time, "SD", -30)
|
||||
else:
|
||||
klu_state_list.append("00")
|
||||
klu_state_list.append("00")
|
||||
klc_index += 1
|
||||
else:
|
||||
klu_state_list.append("00")
|
||||
print(klu_state_list[:20])
|
||||
return klu_state_list
|
||||
|
||||
def get_ema_state(self, dataframe):
|
||||
@@ -918,10 +910,10 @@ class TF_DF():
|
||||
bi_list = []
|
||||
last_top = None
|
||||
last_bottom = None
|
||||
bi_klc_min = 3
|
||||
bi_klc_min = 7
|
||||
last_fx_klc = None
|
||||
for klc in klc_list:
|
||||
if last_fx_klc and klc.index > len(klc_list) - 5:
|
||||
if last_fx_klc:
|
||||
klc.check_klc_state(last_fx_klc)
|
||||
klc.check_fx_confirmed(last_top, last_bottom)
|
||||
fx = self.check_fx(klc)
|
||||
|
||||
Reference in New Issue
Block a user