Hi, I'm looking at and copying this code to get some practice under my fingers, and something doesn't make sense to me:

EMACrossAlpha - QC Github

In this alpha, we're emitting an insight that let's us know if the Fast EMA is above the Slow (InsightDirection.Up) or if the Slow EMA is above the Fast EMA (InsightDirection.Down). 

Here's What I Don't Understand:

1) In the Alphas Update Method, we have this logic:, please see my comments:

for symbol, symbolData in self.symbolDataBySymbol.items(): if symbolData.Fast.IsReady and symbolData.Slow.IsReady: if symbolData.FastIsOverSlow: # Check the boolean property of the SymbolData class if symbolData.Slow > symbolData.Fast: # Why bother checking the boolean property then above? This is the same logic. # And besides that, if FastIsOverSlow returned true to get here why would Slow be greater than Fast? insights.append(Insight.Price(symbolData.Symbol, self.predictionInterval, InsightDirection.Down)) # Again, we're checking for SlowIsOverFast but then if Fast is over Slow on the next line? elif symbolData.SlowIsOverFast: if symbolData.Fast > symbolData.Slow: insights.append(Insight.Price(symbolData.Symbol, self.predictionInterval, InsightDirection.Up)) # Why are we flipping this boolean here? Shouldn't this be done before we emit the insight. Check the values, flip the boolean flag, check the flag, emit the insight... symbolData.FastIsOverSlow = symbolData.Fast > symbolData.Slow

 

2) In the BootCamp tutorial for EMACross, we create a class for SymbolData that contains an Update method for updating the moving values of the EMA's. Why do we not need that class method in this Alpha?
 

3) In any other alogorithm where we want to check the value of a moving average, we have to call access the value on the 'Current.Value" property. Why do we not need to do that in this Alpha? Example Below. 

self.SPYemaSlow.Current.Value > self.SPYemaFast.Current.Value: # Do Something Here