PWB#6 - The Forward Look

I heard a common mistake when creating a backtesting program, is to use the close price of a bar for decision making during that same bar.

The problem is, until that bar is finished, you don't know what the close price will be. You know it while backtesting because it's historical data. But not in real-time trading, and real-time trading is what backtesting is trying to emulate.

And it might not be so obvious that this is going on. If you're explicitly using the close price, then sure, it's obvious. But if you're using an indicator value that is calculated from the close, you might not realise.

Anything related to the close of the bar, can only be acted upon in the next bar.

Thanks to Trader Eyal for this one.