The Repaint Bug Hiding in Most Multi-Timeframe Indicators

The Repaint Bug Hiding in Most Multi-Timeframe Indicators

20 July 2026, 10:40
Ahmed Jazlaan Mohamed
0
8

Multi-timeframe indicators have a common, quiet bug: they repaint. Not in the "the whole indicator redraws itself, that's normal" sense - in the sense that the answer they gave you five minutes ago silently changes, with no explanation, because of how they read higher-timeframe data. Most traders notice the symptom without ever finding the cause.

A concrete example of what this looks like

Say you're on an M15 chart and your indicator checks H1 trend as one of its inputs. At 10:47, the H1 bar that started at 10:00 is still forming - it won't close until 11:00. If your indicator reads that forming bar's EMA or close price right now, and reads it again at 10:52, the values can genuinely be different, because the bar itself hasn't finished yet. Your "H1 bias" can flip from bullish to neutral to bullish again within the same hour, purely because the bar it's reading keeps changing shape as new ticks arrive - not because anything meaningful happened in the market.

This is an easy mistake to make, because reading the current/forming bar (index 0 in MQL5's array convention) is the default, obvious thing to do, and it looks correct in the moment - the indicator responds instantly to price, which feels like a feature. The bug only shows up later, when you notice a signal that "was there" five minutes ago has quietly vanished with no corresponding price move, or a backtest that looked great turns out to have been reading information that wasn't actually available yet at that point in time.

The fix is one word: shift

The fix is to always read shift=1 - the last closed bar - never shift=0. A cell only updates when that timeframe actually finishes a new bar. This means an H4 reading might not move for hours at a time, which can look "stale" if you don't know why - but it's correct. It's telling you the truth about what actually happened, not a live-updating guess about what might happen once the bar finishes.

A quick way to check if an indicator you already use has this bug

Pull up its higher-timeframe reading, note the exact value, then watch it over the next several minutes without any significant price movement. If the reading changes anyway - not because price moved meaningfully, just because time passed - it's very likely reading a forming bar rather than a closed one. This is worth checking on anything you rely on for multi-timeframe context, not just this one.

What I built around this

SmartTrader MTF Trend Bias is a free indicator that reads six timeframes (M1 through H4) the closed-bar way, with each timeframe's reading spelled out in full (Bullish, Bearish, Neutral) rather than a color or symbol you have to decode. It also only re-checks a timeframe's data when that timeframe's own bar closes, rather than polling everything every second - which sounds like a minor performance detail until you're watching H4 and H1 on the same panel as M1 and realize there's no reason to re-read H4's buffers sixty times a minute when it only produces new information once every four hours.

Get it

Free on the Market: https://www.mql5.com/en/market/product/186646?source=Site

This same repaint-safe approach is also what powers the multi-timeframe scanner inside SmartTrader AI Pro, if you want the full six-indicator dashboard this is one piece of: https://www.mql5.com/en/market/product/186191?source=Site