希望 K线形态识别_早晨之星和早晨(希望)十字星( 二 )

<0.005) & (abs(df['openPrice']-df['closePrice'].shift(-2))/df['body_length']<0.005),'three_yeah'] = 1df.loc[(df['sort_three_yeah']==1) & (abs(df['closePrice']-df['openPrice'].shift(-3))/df['body_length']<0.005) & (abs(df['openPrice']-df['closePrice'].shift(-3))/df['body_length']<0.005),'four_yeah'] = 1df['three_m_yeah'] = 0df['four_m_yeah'] = 0df.loc[(df['three_yeah']==1) & ((df['body_length']*0.33+df['closePrice'])>df['highestPrice'].shift(-1)),'three_m_yeah'] = 1df.loc[(df['four_yeah']==1) & ((df['body_length']*0.33+df['closePrice'])>df['highestPrice'].shift(-1)) & ((df['body_length']*0.33+df['closePrice'])>df['highestPrice'].shift(-2)),'four_m_yeah'] = 1df['signal'] = 0df['signal_name'] = ''df.loc[df['three_m_yeah']==1,'signal'] = 1df.loc[df['three_m_yeah']==1,'signal_name'] = '三'df.loc[df['four_m_yeah']==1,'signal'] = 2df.loc[df['four_m_yeah']==1,'signal_name'] = '四'file_name = os.path.basename(daily_file_path)title_str = file_name.split('.')[0]line_data = http://www.kingceram.com/post/{'title_str':title_str,'whole_header':['日期','收','开','高','低'],'whole_df':df,'whole_pd_header':['tradeDate','closePrice','openPrice','highestPrice','lowestPrice'],'start_date_str':start_date_str,'end_date_str':end_date_str,'signal_type':'duration','duration_len':[-1,-2],'temp':len(df.loc[(df['signal']==1) | (df['signal']==2)])}return line_data
结果