Hi I am looking to run a screener which scans for the following: The 20 SMA on the close of the second last bar was below the vwap , followed by the the 20 SMA on the close of last bar was above the VWAP. I am having difficulty with the code for before and after. Any help would be appreciated