Hi!

I have been stuck for a bit validating my code is doing what I am intending to. 

I am using weekly timeframes using consolidator and want to compare SMA(10)[0]  and SMA(10)[1] of SPY using rolling windows for entering position and updating my stop loss.

I am not able to confirm that below lines are picking weekly sma or daily sma. If someone can have a second look it would be really appreciated

 

class SymbolData:
    
    def __init__(self, algorithm, symbol):
        self.algorithm = algorithm
        self.symbol = symbol
        
        self.breakout = False
        self.latest_close = None
        self.index_sma = None
        self.breakout_window = RollingWindow[float](algorithm.breakout_frequency) 
        self.index_sma_window = RollingWindow[float](2) 
        self.stop_loss = None
            
        self.consolidator = TradeBarConsolidator(timedelta(days=7))
        if(self.symbol.Value == algorithm.index_symbol_name):
            self.index_sma = algorithm.SMA(algorithm.index_name,algorithm.breakout_frequency/2,Resolution.Daily)
            algorithm.RegisterIndicator(self.symbol,self.index_sma,self.consolidator)
            self.index_sma.Updated += lambda sender,updated: self.index_sma_window.Add(self.index_sma.Current.Value)
        
            
            # algorithm.Plot("index", "index signal", self.index_sma.Signal)
        self.consolidator.DataConsolidated += self.OnDataConsolidated
        
        algorithm.SubscriptionManager.AddConsolidator(symbol, self.consolidator)
        
        

 

Author