I'm newer to Quantopian and Python. I have the attached dataframe and chart. I want to calculate returns based on (Close Price = SMA 20) - previous (Close Price Below Lower Band = True). How can I set this up in the dataframe? Basically trying to buy when close_price is <= Lower Band and sell when close-price reaches SMA 20 day. Could anyone please help?