Indicator Repaint Inspector
- ユーティリティ
-
Jorge Eliecer Valencia Ferreira
🤖 Quantitative Developer & Algorithmic Trading Specialist | MQL5 & Python
Welcome to my official MQL5 profile. I am a Quantitative Developer and Algorithmic Trader focused on creating high-quality, institutionally robust Expert Advisors with strict risk management. - バージョン: 1.0
- アクティベーション: 10
Repaint Inspector watches another indicator and records, with times and values, whether it changes what it showed on bars that are already closed. It does not tell you what to trade. It only keeps a log of what the other indicator did.
Repainting is one of the most common complaints in indicator reviews: arrows that appear and disappear, signals that are not there when you look at the history later, values that move after the bar closed. A backtest or a screenshot cannot show it, because you only see the final picture. This tool saves what the indicator showed when the bar closed and compares it again every few seconds. If something changed, you get the old value, the new value and how many bars after the close it happened.
It is an indicator. It does not open, close or modify any trade.
How it works
When it starts, it stores the values of the target indicator for the last closed bars (300 by default). Then it keeps reading the same bars at a fixed interval (5 seconds by default) and compares. Each difference is one event, of one of three types:
- VALUE_CHANGED: a closed bar had a value and now has a different one.
- SIGNAL_REMOVED: a closed bar had a value (for example an arrow) and now it is empty.
- SIGNAL_ADDED_LATE: a closed bar was empty and now has a value, so a signal was painted on the past.
Only closed bars are compared. The bar that is still forming is expected to move and is ignored.
How to use it
- Attach the indicator you want to test to a chart and let it load.
- Attach Repaint Inspector to the same chart. In AUTO mode it takes the first indicator it finds on the chart (not itself). If you have several, type part of the name in "Chart indicator short name".
- Leave the chart open. The panel shows WATCHING until enough new bars have closed, then NO REPAINT OBSERVED or REPAINT DETECTED.
- Open the CSV for the full list. Press Reset to clear the counters and start again.
You can also test an indicator by its path (ICUSTOM_PATH mode). In that mode the indicator is loaded with its default inputs, so the result applies to those inputs only.
Panel verdicts
- NO TARGET FOUND: no indicator on the chart, or the path could not be loaded.
- WAITING FOR DATA: a target was found but none of its buffers returned data yet.
- WATCHING (n/m new bars): collecting. The number m is the setting "New bars needed before a clean verdict" (20 by default).
- REPAINT DETECTED (n events): at least one event was recorded. The panel also shows counts for changed, removed and added late, and the last 5 events.
- NO REPAINT OBSERVED: no event after the required number of new bars.
Inputs
Target
- InpTargetMode (default AUTO): AUTO, CHART_INDICATOR or ICUSTOM_PATH. AUTO looks for an indicator on the chart first and uses the path as a fallback.
- InpTargetShortName (default empty): part of the short name of the chart indicator to watch. Empty = first found.
- InpCustomPath (default Examples\ZigZag): indicator path used in ICUSTOM_PATH mode and as fallback in AUTO.
- InpMaxBuffers (default 8): buffers probed, from 0 to N-1.
- InpBufferList (default empty): restrict to some buffers, for example 0,1. Empty = all buffers that return data.
Watching
- InpWatchBars (default 300): closed bars kept under watch. Limited to 20 to 5000.
- InpCheckSeconds (default 5): check interval in seconds.
- InpMinBarsForVerdict (default 20): new bars needed before the panel shows a clean result.
- InpZeroIsEmpty (default true): treat 0.0 as an empty value. Turn it off if the indicator uses 0.0 as a real value.
Output
- InpDrawMarkers (default true): draw a marker on each repainted bar.
- InpSaveCSV (default true): save events to MQL5\Files.
- InpAlertOnRepaint (default true): one pop-up alert on the first event.
Panel
- InpCorner (default top left), InpX (10), InpY (25): panel position.
- InpFontSize (default 9).
- InpColorOk, InpColorWarn, InpColorFail, InpColorText, InpColorBack: panel colors.
Output
Panel on the chart with the verdict, target name, mode, buffers used, closed bars seen, hours watched, counts per event type and the last 5 events.
Chart markers: one arrow on each repainted bar, up to 300. A cross for a removed signal, an up arrow for a signal added late and a dot for a changed value. The tooltip shows the buffer and the old and new values.
CSV file: MQL5\Files\RepaintInspector_SYMBOL_TIMEFRAME.csv, for example RepaintInspector_EURUSD_H1.csv. Semicolon separated. Columns: detected_at; bar_time; buffer; type; old; new; bars_after_close; target. New events are appended, so the file keeps the history of earlier runs on the same symbol and timeframe.
Limitations
- It observes forward in time. It starts recording when you attach it, so it cannot tell you what the indicator did before. A verdict needs closed bars: the more bars close while it runs, the more reliable the result.
- "No repaint observed" means no change was seen during the time it ran, with those inputs, on that symbol and timeframe. It is not proof that the indicator never repaints. Some indicators repaint only in certain market conditions or over longer lookbacks than the watch window.
- It reads indicator buffers. If an indicator draws its arrows as chart objects and keeps nothing in buffers, there is nothing to compare.
- The terminal and the chart must stay open while it watches. If the terminal is closed, nothing is recorded.
- It compares values only. It does not judge whether signals are good, late or profitable.
- The target must be calculated on the newest bar before a comparison is made. If the target is slow, the check waits a few cycles.
- If the target is removed from the chart, the tool looks for another one (in AUTO and CHART_INDICATOR modes).
Strategy Tester demo
In the Strategy Tester the tool cannot read indicators attached to a chart, so it loads the standard ZigZag that comes with MetaTrader 5 (Examples\ZigZag) with default inputs. The ZigZag is known to move its last swing as price develops, so the demo may record events; if none appear in a short run, the panel stays in WATCHING. The panel and markers appear only in visual mode. To test your own indicator, use it on a live or demo chart, or enter its path in the inputs.
Notes
- Works on any symbol and any timeframe.
- It uses a 5 second timer by default and compares stored arrays, so it is light on the terminal.
Risk warning: this tool analyses the behaviour of an indicator's values. It is not trading advice, it does not generate signals and it does not predict results.
