Why your indicator repaints (and how to prove it does not)

19 October 2026, 07:46
Jevon Naldo Yoshield
0
34
Most indicators that claim not to repaint do repaint. The cause is rarely dishonest intent. It is a misunderstanding of how MetaTrader delivers bar data. MetaTrader hands OnCalculate its price arrays oldest to newest. Index 0 is the oldest bar loaded. Index rates_total - 1 is the bar still forming. That last one moves on every tick. The rule that prevents repainting: never derive a permanent value from index rates_total - 1. Three consequences: 1. ArraySetAsSeries does not fix this. 2. Split detection (closed bars) from presentation (forming bar). 3. Prove it: rebuild from closed bars on attach, compare. Closed-bar logic makes signals reproducible, not profitable.