Hi Fred and Vladimir,
Thank you guys for the replies! I really appreciate it since yesterday was a holiday (Good Friday) and you guys are still active in the community!
From the code that you guys sent, I realized the issue was with the first parameter in the TradeBar() function, this is what I had:
bar = TradeBar(time, self.symbol, row.open, row.high, row.low, row.close, row.volume, datetime.timedelta(hours=1))
What I should've done was the following for hour historical data:
bar = TradeBar(time - datetime.timedelta(hours = 1), self.symbol, row.open, row.high, row.low, row.close, row.volume, datetime.timedelta(hours=1))
And the following for minute historical data:
bar = TradeBar(time - datetime.timedelta(minutes = 1), self.symbol, row.open, row.high, row.low, row.close, row.volume, datetime.timedelta(hours=1))
However, I do have an additional question, do you guys know the purpose or significance of the last parameter of the TradeBar function? I find that the consolidated bars created are the same with or without it like so:
# With last paramter
bar = TradeBar(time - datetime.timedelta(minutes = 1), self.symbol, row.open, row.high, row.low, row.close, row.volume, datetime.timedelta(hours=1))
# Without last parameter
bar = TradeBar(time - datetime.timedelta(minutes = 1), self.symbol, row.open, row.high, row.low, row.close, row.volume)