This is the third part of a series. PART1 (EQUIVALENCE CHECKER) tests whether an incremental, tick-by-tick calculation matches a calculation from scratch. PART 2(WARM UP METER) measures how much history a recursive indicator needs before its seed error disappears. This part asks a different question: does the value of a closed bar ever change when later bars arrive?
If it does, the indicator repaints or looks ahead. On a live chart that means a signal shown at the close of a bar may later move or vanish. In a backtest it is worse: the test reads the final values of the buffers, which contain information that did not exist when the bar closed, and the result is better than anything that could have been traded.
The audit rebuilds what the indicator could have known, bar by bar:
Four test subjects are built in, selected with InpSubject . Two are controls that must pass, and two contain the typical mistakes, so you can see that the audit really fails when it should (the same idea as the fault injection in Part 1):
| Subject | What it does | Result on the fixed series (M15, 400 bars, tolerance 1e-9) |
|---|---|---|
| SMA(14) | Average of the last 14 bars. Control. | 0 of 400 bars changed. PASS. |
| EMA(14) | Recursion over InpWarmupBars bars up to the bar. Control. | 0 of 400 bars changed. PASS. |
| Centered MA(14) | Average of 7 bars on each side. Reads bars that do not exist at close. | 393 of 400 changed, each needing exactly 7 future bars. FAIL. The newest 7 bars have no value even now, so they count as unchanged. |
| Swing high(5) | Signal when a bar is higher than the 5 bars on each side. At close only the left side exists, so the signal is shown provisionally. | 73 of 400 changed, needing at most 5 future bars (1.6 on average). FAIL. The signals that were withdrawn are the changed bars. |
The numbers depend on the last closed bar, so they change a little from bar to bar.
To audit your own indicator, replace the body of Subject ( i, known) in the source. It must return the value of bar i when only the bars up to index known exist, and it must read every price through Px(k, known) . That accessor returns "no number" for any bar after known , so an indicator that reads a future bar (for example close[i+1] after a series-direction mistake) cannot silently pass: it gets no value at close and is reported. Return EMPTY_VALUE where your indicator draws nothing.
How the three parts fit together: Part 1 checks the state handling of the calculation, Part 2 sizes the history it needs, and Part 3 checks that closed-bar values do not depend on bars that come later. For the EMA subject, both evaluations start the recursion at the same bar ( InpWarmupBars bars before it), so the seed error measured in Part 2 is not mistaken for repainting. Use the warm-up recommended by the Warm-Up Meter.

Fig. 1. Swing high (5 bars on each side) on the fixed M15 series, 400 audited bars. Each white bar is a bar whose value at close was changed by later bars: 73 of 400, needing at most 5 future bars. Unchanged bars have error index 0 and draw nothing. Black and white screenshot, per the Code Base image guidelines.
| Input | Default | Purpose |
|---|---|---|
| InpSubject | Swing high (provisional signal, repaints) | Algorithm under test: SMA and EMA (controls that must pass), centered moving average (reads future bars), swing high (provisional signal that repaints). |
| InpPeriod | 14 | Averaging period of the SMA, EMA and centered moving average. Values are limited to 2..200. |
| InpSwingBars | 5 | Bars on each side of a swing high. Values are limited to 1..50. |
| InpWarmupBars | 200 | History used to start the EMA before each bar. Use the value recommended by the Warm-Up Meter (Part 2). Limited to 10..2000. |
| InpDataset | Fixed synthetic series | Data source: the fixed series (a function of bar open time, identical to Parts 1 and 2) or the chart close prices. |
| InpAuditBars | 400 | Number of newest closed bars audited. Limited to 20..2000. |
| InpMaxLag | 50 | Future bars checked when measuring how long a changed value keeps changing. Limited to 5..200. |
| InpTolerance | 1.0e-9 | Relative tolerance. Larger differences count as a change. Limited to 1e-15..1e-3. |
| InpShowPanel | true | Show or hide the status panel. |
| InpTextColor | clrSilver | Color of the panel text. |
Volatility Regime Percentile
Ranks the current ATR against its own recent history and colours each bar as a LOW, NORMAL or HIGH volatility regime, with a panel showing ATR in price and points, ATR vs its median and how long the regime has held.
Trade Settings — Persist and Migrate Per-Trade Settings
Standalone MQL5 library for storing custom settings separately for each trade and following a verified pending-order-to-position lifecycle. It supports double, ulong and price-unit fields, terminal-local Global Variables, safe cleanup gates and an offline self-test. Includes a demo EA, source archive, and installation guide. A different-ticket transition, reconnection as a separate scenario, and netting behavior remain untested.
Accelerator Oscillator (AC)
The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.
MACD Signals
Indicator edition for new platform.