I copy pasted the quickstart code under "The broker says: Show me the money!" and adjusted filename and following feed params:
data = data = btfeeds.GenericCSVData(
fromdate=datetime.datetime(2017, 1, 1),
todate=datetime.datetime(2017, 1, 5),
dtformat=('%Y-%m-%d %H'), # it is hourly data
headers = True,
The csv contains datal like this:
Date, High, Low, Open, Close, Volume
2011-09-13 15, 6.000000000000, 5.800000000000, 5.800000000000, 6.000000000000, 25.000000000000
2011-09-13 16 , 5.950000000000, 5.760000000000, 5.950000000000, 5.760000000000, 22.353982380000
So that should be hourly bars.
But when executing the self.buy() the buy is not executed at next bar, but at next day.
How to change from Daily to Hourly?
I tried to add
timeframe = bt.TimeFrame.Hours
but 1) this is only used for Resampling (dont know yet what it is) and 2) does Hours not exist.
So question is not only about "hourly" it is about customized bars, so even 2 hourly or 0.5hourly and so on.