修改排版,加入up,down,flat,unknown显示
This commit is contained in:
+11
-5
@@ -74,18 +74,24 @@ class ChanLun():
|
||||
if len(self.tf_df_dict) > 0:
|
||||
return {key: self.tf_df_dict[key].get_ema24() for key in self.ema_symbols}
|
||||
return None
|
||||
def get_current_klc_dict(self):
|
||||
if len(self.tf_df_dict) > 0:
|
||||
return {key: self.tf_df_dict[key].get_current_klc() for key in self.ema_symbols}
|
||||
return None
|
||||
def cal_bsp(self):
|
||||
return
|
||||
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")
|
||||
if klc.close > klc.ema52 or klc.next.close > klc.next.ema52:
|
||||
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.close < klc.ema52 or klc.next.close < klc.next.ema52:
|
||||
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 add_indicators(self, df):
|
||||
fast = 12
|
||||
|
||||
Reference in New Issue
Block a user