📜  bill wiliams 分形 python pandas - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:37.753000             🧑  作者: Mango

代码示例1
def roll(df):
    bear_fractal = df['high'].rolling(5, center=True).apply(lambda x: x[2] == max(x), raw=True)
    bull_fractal = df['low'].rolling(5, center=True).apply(lambda x: x[2] == min(x), raw=True)
    return bear_fractal, bull_fractal