Repaint Diagnostic Overlay
"Does this indicator repaint" is usually answered by staring at a chart and trusting memory, which is exactly the kind of judgement humans are bad at. This tool answers it with a record instead of an impression: the first time a bar closes, its indicator value is saved. Every time that same bar is re-evaluated afterwards, the saved value is compared against the current one. If they differ, the bar is marked with a red arrow - the indicator changed its own history, which is the definition of repainting. The saved snapshot is written to a terminal global variable, not a plain in-memory array, specifically so the record survives a chart reload or an indicator recompile within the same terminal session. An in-memory-only snapshot would be wiped every time OnInit runs again, letting a genuinely repainting indicator falsely pass the check simply because the trader reloaded the chart to look more closely. Nine common built-in indicators are supported directly (see INPUT PARAMETERS). None of MetaTrader's stock indicators are known to repaint under normal settings, so this tool is most useful as a template a trader adapts to check indicators they are less sure about, and as a demonstration of what a genuinely non-repainting result looks like over time. Notes and limitations - The baseline snapshot is only as good as the first read - if the chart is loaded partway through a session with an indicator that already repainted its recent bars before this tool started watching, that earlier repaint is invisible; only changes occurring after this indicator first saw the bar are detected. - Snapshots are stored as terminal global variables, which persist until the terminal's global variable list is cleared or they expire; a very long test across many symbols and timeframes accumulates many entries. They are namespaced by symbol, timeframe and indicator name to avoid collisions but are not automatically deleted by this indicator. - Only the nine listed built-in indicators are supported, for the same self-containment reason as the InpIndicatorName restriction in IndicatorEdgeScanner - reading a custom indicator via iCustom would require the trader's own compiled file, which cannot be assumed present. - This is a diagnostic, not a guarantee: it can only flag a change it actually observes while running, so a genuine no-repaint verdict requires leaving the chart running long enough to accumulate a meaningful number of re-checked bars.
Indicator · MT4 · v1.0 · Free
About Repaint Diagnostic Overlay
Repaint Diagnostic Overlay is an indicator for MetaTrader 4 based on MACD, RSI, CCI and ADX. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Indicator name, Indicator buffer and Period. MQL source code included.
Files in the download: RepaintDiagnosticOverlay.ex4, RepaintDiagnosticOverlay.mq4, RepaintDiagnosticOverlay.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Indicator name | Momentum | Built-in indicator being watched, see the .txt for the supported list |
| Indicator buffer | 0 | Buffer selector for MACD/ADX (0=main, see .txt) |
| Period | 14 | Period passed to the watched indicator |
| Scan bars | 300 | How many closed bars back are re-checked each run |
| Change tolerance | 0.0000001 | Minimum absolute difference counted as a real change, not float noise |
| Alert on repaint | true | Alert the first time any bar is newly flagged |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Buy/Sell Arrows · Alerts · MACD · RSI · CCI · ADX · MT4 Indicator · MQL4 Source Code