Hello, I have coded the attached algo that use multiple symbols to go long and short based on fundamental and technical conditions. On the current state, the algo doesn't trade any stock because the TradeBar consolidator with the rolling window is not working. I mean the rolling window self.Bars which is defined for each symbol in the SymbolData class, has the same values for today and yesterday. 

On the OnSecurityChange, there is the logic to use the SymbolData class to add indicators as well as rolling window for each symbol.

The problem is that when I create the variables to test for the technical conditions for entries, the variables 

yesterdayBar = symbolData.Bars[1]
todayBar = symbolData.Bars[0]

on line 262-263, has the same values(yesterday close is equal to today close and so on). So any trade could be triggered because this dont allow signals, as one of the signals are based in the comparisson between yesterday and today bars. 

I think that Im missing something regards the update of this bars, but couldn't found a solution yet. I really appreciate any help in this issue.

 

Thanks

Nicolás 

 

Author