The indicator that predicted the future for three weeks
Posted: Sat Oct 31, 2026 7:21 pm
A story that repeats in different forms every year. Someone codes a reversal signal that uses a stochastic style oscillator plus a pivot detector. In the backtest it calls turning points with startling precision. Entries sit right at the lows of pullbacks, stops are tiny, and the equity curve is nearly a straight line. Time to go live.
Live, the signals show up late or not at all, and the ones that do show up are often wrong. What was happening?
The pivot detector marked a low only if the bars on both sides were higher. In the historical chart, the bars to the right already existed, so the signal was drawn on the bar where the low occurred. In real time, the confirming bars had not formed yet, so the indicator could not know that low was a low. The backtest was effectively reading the answer off the next page.
The twist: the code looked fine. Nothing referenced a future bar explicitly. The leak came from a smoothing function that, on the current bar, used a value that was still changing, and on past bars used the final one. During testing, every bar was evaluated after it closed. Live, the current bar's values moved with each tick, and the signal flickered on and off.
Ways this tends to hide:
- Highs and lows of the current bar used in a condition that fires on that same bar.
- Zigzag or pivot tools that repaint as new bars arrive.
- Higher timeframe values read before that higher bar has closed.
A quick test is to record signals live for a few days, then compare them against what the same indicator shows on the same bars afterward. Any difference is repainting or leakage. Another is to shift the signal by one bar and see whether the edge collapses.
Has any indicator you trusted turned out to be using information it should not have had, and how did you catch it?
Live, the signals show up late or not at all, and the ones that do show up are often wrong. What was happening?
The pivot detector marked a low only if the bars on both sides were higher. In the historical chart, the bars to the right already existed, so the signal was drawn on the bar where the low occurred. In real time, the confirming bars had not formed yet, so the indicator could not know that low was a low. The backtest was effectively reading the answer off the next page.
The twist: the code looked fine. Nothing referenced a future bar explicitly. The leak came from a smoothing function that, on the current bar, used a value that was still changing, and on past bars used the final one. During testing, every bar was evaluated after it closed. Live, the current bar's values moved with each tick, and the signal flickered on and off.
Ways this tends to hide:
- Highs and lows of the current bar used in a condition that fires on that same bar.
- Zigzag or pivot tools that repaint as new bars arrive.
- Higher timeframe values read before that higher bar has closed.
A quick test is to record signals live for a few days, then compare them against what the same indicator shows on the same bars afterward. Any difference is repainting or leakage. Another is to shift the signal by one bar and see whether the edge collapses.
Has any indicator you trusted turned out to be using information it should not have had, and how did you catch it?