I am trying to create a simple moving average filter. I use a for loop to compute the percent difference of 3d and 45d sma for each stock symbol in the coarse universe. Then I sorted the dictionary based on the value and returned a list of the bottom 100 stocks.

For some reason, the sma().current.value gives me a "0". I read some docs and posts related to this but haven't figured out how to some this problem. Basically, I'm trying to create a sma filter based on the current universe instead of a single stock. I would be apprecieted if someone can help me out.