How to prove your indicator does not repaint: a self-audit pattern

A claim that an indicator "does not repaint" is only worth as much as the proof behind it. Most indicators that make this claim have never been tested for it, because the defect is invisible in the tester and on a history screenshot. It only shows up while you are watching a live bar.

The pattern I use is simple and cheap to implement.

1. On attach, rebuild every object from scratch using only closed bars (rates_total - 2 and older). Store the resulting level or record.

2. Compare the rebuilt result against what the indicator currently holds. Same count, same price levels within a tolerance. If anything moved, you have found a repainting bug before your users do.

3. Run the audit only on attach and only over the region actually scanned. Auditing bars that were never scanned produces false failures.

4. Log the result: "N closed bars re-checked, levels match, no repaint detected." or "N closed bars re-checked, M mismatch(es) found."

Two known limits worth stating honestly:

- The audit checks the first matching record, so a duplicate passes silently. It runs on attach, not on every tick.
- It proves reproducibility, not profitability. A non-repainting indicator can still be wrong.

The uncomfortable part is that a repainting indicator usually looks perfect in the tester. If your levels look stable while the bar is still forming, that is the defect, not a feature.

What audit patterns are other people using? I am curious whether anyone runs a per-tick comparison instead of an attach-time one.