Thank you both, and thank you for your patience. I think I have misunderstood the Cerebro.resampledata
method. My example above was incorrect, here's the code I tried:
import datetime
# my backtrader __version__ = '1.9.58.122'
import backtrader as bt
if __name__ == '__main__':
cerebro = bt.Cerebro()
data = bt.feeds.GenericCSVData(
dataname="some-5m-data.csv",
fromdate=datetime.datetime(2015, 1, 1),
todate=datetime.datetime(2015, 12, 31),
openinterest=-1,
timeframe=bt.TimeFrame.Ticks)
cerebro.resampledata(d, timeframe=60*bt.TimeFrame.Minutes)
#cerebro.resampledata(data,
# timeframe=bt.TimeFrame.Ticks,
# compression=12)
cerebro.run()
I'd like to turn my 5m data into hourly data. Now I think that multiplying 60 times TimeFrame.Minutes
is not meaningful and instead I should do the thing that's commented out above... Is this correct? Compress 12 5m bars into a single 60m bar?
Thanks again!