Hi all 

I am new to writing in python. I typically have been coducting my back tests using R and using data frames or basically working with historical data. 

I started to learn on Quantopian, however, I am now here! 

So what I am trying to do is make a rolling z-score of a price series: 

# Create zscore
self.sma = self.SMA("SPY", 20, Resolution.Daily);
self.std = self.STD("SPY", 20, Resolution.Daily);
self.zscore = (SPY.Close.Current.Value - self.sma.Current.Value) / self.std.Current.Value

I am storing this in     def Initialize(self):

 

My confusion lies in how the indicators are created... are they based on the Close price, or do i need to specify that? 

Also as far as making indicators in this way, if i do the zscore calculation: 

(close - sma) / std dev... 

Will this take the current price or do i need to specify? 

Getting hung up on the small stuff, anyone shed some light? 

Thanks

Andrew