Filter_Stock_CHN_1.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:StockRecommendSystem 作者: doncat99 项目源码 文件源码
def macd_rule(df):
    try:  df = MACD(df)
    except: return False

    input_1 = 0.2
    input_2 = -0.8
    input_3 = 22 * 3
    index = -1
    df['macd_dif_1'] = df['macd_dif'].shift(1)
    df['macd_dea_1'] = df['macd_dea'].shift(1)

    return (abs(df['macd_dea'][index]) < input_1) & \
           (abs(df['macd_dif'][index]) < input_1) & \
           (df['macd_dif'][-input_3:].min() < input_2) & \
           (df['macd_dif'][index] > df['macd_dea'][index]) & \
           ((df['macd_dea_1'][index] > df['macd_dif_1'][index]) | (abs(df['macd_dea_1'][index] - df['macd_dif_1'][index]) < 0.007))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号