Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
3 lower lows

How can I code for a pattern that has the previous 3 days with lower lows and the current day closes above yesterdays high for a buy signal?
Not sure how to code a pattern setup in Python.

1 response

@gary,

Try something like this:

    lows = data.history(stock, 'low', 4, '1d')  
    three_lower_lows = lows[-1] < lows[-2] < lows[-3] < lows[-4]