Is anyone aware of a backtesting framework that supports multi-timeframes without either unnecessary lag by using the last complete bar or introducing look forward bias by using a complete bar that has data from the future?
For example, a backtest is iterating through 5m bars and is currently evaluating the bar at 03:45am. Any 5m indis would be calculated as of the close of that bar. But let's say you wanted to also evaluate against indis at a higher timeframe such as the 1 hour. Evaluating the prev complete 1hr bar (2am) would result in excluding action after 3am (unnecessary lag.) Using a complete 1h bar at 3am would include data from 03:50 through the end of the hour which doesn't yet exist at the end of the 03:45am bar (look forward bias.)
Ideally, any multi-tf indis would use a partially complete bar on the right side to simulate what we'd actually be seeing in real time if we went back to that point in time. So in this case it would be the incomplete 1h bar that is painted at the same time as the 3:45am 5m bar.
Hopefully this question makes sense.
Can you help answer these questions from other members on futures io?
With Ninjatrader you can tell your indicator to get updated OnBarClose which means once at the close of the bar. OnEachTick means on every single tick. OnPriceChange means once for each price change. This way you can eliminate what you call unnecessary lag by using the last completed bar.
Here is a screen capture of the ES today 1 min chart using 2 EMA of the same length (20) where the large one is on bar close and the other on each tick. As you can see, there is no need for a multi-timeframe chart configuration.
The following 2 users say Thank You to trendisyourfriend for this post:
Thanks very much for the response and especially the link to the help files. There is a section on dealing with multiple timeframes that talks about the Calculate.OnEachTick property.
It's not an exact fit for what I was searching for, but fairly close. It certainly beats having to code everything myself.
The following user says Thank You to bp2012 for this post: