def check_single_stk_hour_macd_wx(stk_code, source='jq'): df_30, df_60 = gen_hour_macd_values(stk_code, source=source, title='') l_60 = df_60.tail(3)['MACD'].values l_30 = df_30.tail(3)['MACD'].values if l_60[1] == np.min(l_60): title_str = '60分钟开始上涨' sts = 1 elif l_60[1] == np.max(l_60): title_str = '60分钟开始下跌' sts = 2 elif l_30[1] == np.max(l_30): title_str = '30分钟开始下跌' sts = 3 elif l_30[1] == np.min(l_30): title_str = '30分钟开始上涨' sts = 4 else: title_str = '当前无拐点' sts = 0 # 避免重复发图! if stk_code in MACD_min_last.keys(): if MACD_min_last[stk_code] != sts: send_pic = True MACD_min_last[stk_code] = sts else: send_pic = False else: send_pic = True MACD_min_last[stk_code] = sts if send_pic & (sts != 0): return code2name(stk_code) + '-' + title_str + '\n' else: return ''
# encoding=utf-8