We're looking at changing the way we manage data granularity in backtests. I'd like to share our ideas and get some feedback from you.
How it works today: When you are coding your algorithm in the IDE, when you build your algorithm, we show you a backtest on the right-hand side of the screen. That backtest is done using daily data bars. When you run a full backtest, we're using the per-minute data.
The planned change: We've had a lot of requests from people who want to do full backtests on daily, not minutely data. Our current plan is to give full control to you. Within intialize(context), you will be able to run a function called set_granularity() that can be minute or daily. It would look something like this:
initialize(context)
set_granularity(minute)
Exploring this a bit further:
- The backtest will use this setting for both instant backtests and
full backtests. That means the "instant backtest" will actually be
relatively slow for minute-level testing. Minute-level testing in the
IDE will work best when using a smaller date range. - If you don't specify the granularity, the default will be daily.
- This leaves room to do hourly or weekly or other granularities in the future.
What are you thoughts on that change?