Hello!

I've followed the “Fading the Gap” tutorial in order to calculate short term volatility (I believe its the volatility over the course of a night). The result is that it outputs how many deviations there have been which is perfect for what I want to do. 

The issue comes when I try to copy the same method but for calculating the volatility over the course of a year. There are consistently over a hundred deviations. This means I haven't set it up properly, but I'm not sure what I could do to change it.

Thanks for the help!

 

#Set volatility trackers in Initialize
 self.volatilityShort = StandardDeviation("SPY", 30)
 self.volatilityLong = StandardDeviation("SPY", 365)
 
#The rest is in OnData
 if data["SPY"] is not None:
            self.volatilityShort.Update(self.Time, data["SPY"].Close)
            self.volatilityLong.Update(self.Time, data["SPY"].Close)
 
 
 deltaShort = self.window[0].Open - self.window[1].Close       
 deltaLong = self.window[0].Open - self.window[364].Close
 
 deviationsShort = deltaShort / self.volatilityShort.Current.Value
 deviationsLong = deltaLong / self.volatilityLong.Current.Value