If you have an indicator or strategy that uses another timeframe, let's call it timeframe B, (and the primary timeframe let's call timeframe A) and you want to perform some action on timeframe A based on some indicator that's calculating it's values on timeframe B, your historical calculations (and therefore actions) will be all inaccurate. Let me explain:
When NT calls an OnUpdateBar for the timeframe A, you are at the close of a bar on timeframe A. However, you will most likely be in the middle of a bar on timeframe B. Because timeframe B's bar has not closed, it's bar should have the same "current price" (closing price) as the timeframe A, as this is currently the most recently known price.
However NT will simply uses the previous bar (this is if you use BarsArray[1][0]), which is problematic if you are relying on intrabar evaluations on timeframe B.
Naturally the High's and Low's are also a problem; and while this may be a small error if your timeframe B is not so large, it's a much bigger problem the larger that timeframe.
Basically it means you are must use the market replay to do accurate backtesting, which is a pity considering how comprehensive the backtesting tool in NT is.
It seems to me that the information is already basically there for timeframe B for a better way to do this: the Open of the next bar for timeframe B is known, as well as the current price, so you have the information to create an interim bar for timeframe B (except the high or low would be problematic, but at least you have the open/close).
Jeremy
Comment