I might be overlooking something simple here but I cannot understand why the 2 following codes don't produce the same results. They both create market orders at the exact same time. However, when I'm consolidating data myself, I always get worse fill prices. I have tested it with multiple different equities and time periods. In the added example the first difference is shown in the 2nd order. 

# example 1: without consolidating data manually

class CalibratedParticleCoreWave(QCAlgorithm):

def Initialize(self):
self.SetStartDate(2020, 1, 1)
self.SetEndDate(2020, 2, 1)
self.SetCash(100000)

self.symbol = self.AddEquity("SPY", Resolution.Hour, Market.USA, False, 2, False)

def OnData(self, data):
if self.Portfolio.Invested:
self.SetHoldings("SPY", -1)
else:
self.SetHoldings("SPY", 1)




# example 2: with consolidating data manually

class CalibratedParticleCoreWave(QCAlgorithm):

def Initialize(self):
self.SetStartDate(2020, 1, 1)
self.SetEndDate(2020, 2, 1)
self.SetCash(100000)

self.symbol = self.AddEquity("SPY", Resolution.Minute, Market.USA, False, 2, False)

self.Consolidate("SPY", timedelta(minutes=60), self.OnDataConsolidated)

def OnDataConsolidated(self, bar):

if self.Portfolio.Invested:
self.SetHoldings("SPY", -1)
else:
self.SetHoldings("SPY", 1)

def OnData(self, data):
pass