Apparently, history does not return a python DataFrame when combined with a Universe.

This works and returns a python DataFrame with highs, lows and closes for the selected securities:

class algorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2012,1,1) self.SetEndDate(2012,2,5) self.SetCash(100000) self.symbols = ['ABT', 'ACN', 'ACE', 'ADBE'] for symbol in self.symbols: self.AddEquity(symbol, Resolution.Daily) self.AddEquity('SPY', Resolution.Daily) self.Schedule.On(self.DateRules.MonthStart("SPY"), self.TimeRules.AfterMarketOpen("SPY", 60), Action(self.Rebalance)) def Rebalance(self): history = self.History(self.symbols, 20, Resolution.Daily) self.Debug(history.head())

This throws an error:

class algorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2012,1,1) self.SetEndDate(2012,3,1) self.SetCash(100000) self.AddEquity("SPY", Resolution.Minute) self.UniverseSettings.Resolution = Resolution.Minute self.Schedule.On(self.DateRules.EveryDay("SPY"), self.TimeRules.AfterMarketOpen("SPY", 30), Action(self.rebalance)) self.universe = [] def CoarseSelectionFunction(self, coarse): today = self.Time CoarseWithFundamental = [x for x in coarse if x.HasFundamentalData] sortedByDollarVolume = sorted(CoarseWithFundamental, key=lambda x: x.DollarVolume, reverse=True) result = [ x.Symbol for x in sortedByDollarVolume[:self.__numberOfSymbols] ] self.universe = result return self.universe def rebalance(self): history = self.History(20, Resolution.Daily) self.Debug(history.head())

How can I change the second snippet such that it returns a DataFrame with the bars for all the assets in the Universe? 

Author