Possible to change 4-hr bar start time?
I am working on a BT strategy trading HSI Futures using IB aaa broker. Is there a way that I can have one hour bar from IB resampled to 4 hours bar and also adjust the start time of the 1st bar of the day to 9:00am instead of from 8:00?
With trading hours of HSI futures: 9:15 am - 12:00 noon, 1:00 pm - 4:30 pm & 5:15 pm - 3:00 am.
If I can adjust the 1st 4-hr bar to start at 9:00 then I can have the full day separated into 4-hr sessions with 9:00-12:59, 13:00-16:59, 17:00-20:59, 21:00-00:59, 01:00-04:59.
run-out last edited by
@you Normally one would use boundoff as follows:
cerebro.resampledata( data, timeframe=bt.TimeFrame.Minutes, compression=240, boundoff=180 )
But sadly when I try to execute this in IB if doesn't work.