Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

bill wiliams fractal python pandas

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
Source by codereview.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #bill #wiliams #fractal #python #pandas
ADD COMMENT
Topic
Name
8+2 =