Page 1 of 1

The ZigZag indicator and repainting: why it looks perfect on old charts and lies in real time

Posted: Sun Nov 22, 2026 9:11 am
by Shadow Trader
ZigZag is one of the most misleading indicators on a chart, not because it is wrong, but because of when it is right. It connects swing highs and lows whenever price reverses by more than a set amount, usually a percentage or a number of points. On historical data it draws a clean outline of every meaningful swing, and it can make any strategy look brilliant when you study it after the fact.

The catch is that the last leg of the ZigZag is always provisional. While price is moving, the indicator keeps extending the current leg. If price reverses by the threshold amount, a new swing point is confirmed, but only after the reversal has already happened. If price then makes a new extreme, the last point can move. That behaviour is what people call repainting.

That causes a couple of common problems:

- Backtests or visual reviews that use ZigZag points as entry signals. Those points weren't known at the time, so the test is using future information.
- EAs that read ZigZag buffer values without understanding that the most recent value can change, leading to signals that appear and then vanish.
- Patterns like harmonics or Elliott counts drawn on ZigZag swings, where the most recent point, the one that matters most, is the one that is least certain.

ZigZag is still useful as a way to describe structure, measure average swing size, or label past swings for study. It just can't be treated as a signal without accounting for the delay. A fair way to use it is to record where price was at the moment a swing was confirmed, not where the swing point is drawn.

For anyone who uses swing detection in an EA, what do you use instead of ZigZag, or how do you handle its last leg?