Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to find previous 2 previous swing low and high in 1 minutes time frequency

Hi,

How to find previous 2 previous swing low and high in 1 minutes time frequency,

I have price history of 2 days in dataframe, I would like to create another dataframe keeping history of previous 2 swing lows and highs. How to achieve this?

Please assist.