I want to resample or replay data by quarter, but find that bt.TimeFrame
only support 'Days', 'Weeks', 'Months', 'Years'
,there is no 'Quarters'
option.
I know a simple way to process data quarterly is use compression
, for example:
tframes = dict( daily=bt.TimeFrame.Days,
weekly=bt.TimeFrame.Weeks,
monthly=bt.TimeFrame.Months)
cerebro.replaydata(data,timeframe=tframes['monthly'],compression=3)
You have to make sure the data is started on January,or the result will only compression by 3 continuous months, not by quarter.
I hope someone could help me to solve this problem.