Okay, I came up with following solution. Unfortunately it's not pretty and I don't know if multiple consolidators for multiple symbols can be added, (for example, both 30min and 5min consolidators for each asset), but the current implementation works.
I created a "for i in range" loop to add close prices to the list variable, and it turned out that I had to make another string version of "symbol" var in order to be able to access my pandas dataframes.
I still can't understand tho how to properly add WarmUp period in case you are using consolidators, especially multiple ones like 30m & 5m for each asset.Â
And one more question, in case of using Universe selection, is it possible to make your Universe give you the assets it chose in list format?
Current solution:
I still dont like these two lines of code:
for i in range (0,65):
        closes.append(bars[i].Close)
I still think it can be done better. Kinda perfectionist I am, I guess.
def MakeCalculations(self):
if not all([window.IsReady for window in self.data.values()]):
return
#list of close prices of the last 65 30-minute bars
closes = []
for symbol in self.data.keys():
bars = self.data[symbol]
sym = str(symbol)
for i in range (0,65):
closes.append(bars[i].Close)
self.Levels['LC'][sym] = LC = min(closes)
self.Levels['HC'][sym] = HC = max(closes)
self.Levels['MeanC'][sym] = MeanC = np.mean(closes)
closes[:] = []
def OnData(self,data):
if not all([window.IsReady for window in self.data.values()]):
return
for symbol in self.data.keys():
bars = self.data[symbol]
sym = str(symbol)
if self.Traded[sym] == False:
if bars[0].Low <= self.Levels['LC'][sym] and bars[0].Close >= self.Levels['LC'][sym]:
self.MarketOrder(symbol, 1)
self.Traded[sym] = True
Â