WhitmanTrading

ZigZag Indicator: The Setting Is the Analysis

The ZigZag indicator draws straight lines between significant highs and lows, ignoring moves smaller than a chosen threshold. It is a measuring tool rather than a signal, because the most recent leg is always provisional until price moves far enough to confirm the pivot.

How it works

A candlestick chart of the site's shared price history. The headline on the chart reads: A line through the swings, drawn after they happen.
A line through the swings, drawn after they happen. Illustrative chart - not real market data.

The ZigZag connects significant turning points with straight lines and ignores everything smaller than a threshold you set. What it removes is the point of it.

A gently rising stretch of the long price series. The headline on the chart reads: A pivot confirms only once price moves back by the threshold.
A pivot confirms only once price moves back by the threshold. Illustrative chart - not real market data.

A pivot is not confirmed when it prints. It is confirmed when price has moved back from it by the threshold amount. Until then the running extreme keeps updating and the line keeps moving.

A calmly advancing stretch of the long price series. The headline on the chart reads: Which means the last leg is always provisional.
Which means the last leg is always provisional. Illustrative chart - not real market data.

So the final leg redraws. This is not a flaw to be fixed — it is the definition working correctly, and it is why a zigzag on a completed chart looks like it caught every turn.

The threshold decides everything

A choppy, directionless stretch of the long price series. The headline on the chart reads: At half a per cent this history has 175 pivots.
At half a per cent this history has 175 pivots. Illustrative chart - not real market data.

On this site’s shared 576-bar history a 0.5% threshold produces 175 pivots — one every 3 bars, with a median leg of 2 bars and 1.21 price units.

A flat, quiet stretch of the long price series. The headline on the chart reads: At three per cent it has 15. The setting is the analysis.
At three per cent it has 15. The setting is the analysis. Illustrative chart - not real market data.

A 3% threshold on the same 576 bars produces 15. One every 38 bars. Same data, same tool, eleven times fewer swings — and every conclusion about structure changes with it.

A strongly rising stretch of the long price series. The headline on the chart reads: Median leg length goes from 2 bars to 26.
Median leg length goes from 2 bars to 26. Illustrative chart - not real market data.

The intermediate settings fill the gap smoothly. 1% gives 85 pivots and a 5-bar median leg; 2% gives 32 and 13 bars. There is no natural setting hiding in the data, which means the choice is yours and it should be made deliberately and written down.

A declining stretch of the long price series. The headline on the chart reads: It is a measuring tool and it is not a signal.
It is a measuring tool and it is not a signal. Illustrative chart - not real market data.

This is why it is not a signal generator. A tool whose output depends entirely on a parameter you chose, and whose most recent value is provisional, cannot tell you what to do next. It can tell you what has already happened, precisely and reproducibly, which is a genuinely useful thing.

In practice

A candlestick chart with a volume histogram beneath it, with the volume histogram emphasised. The headline on the chart reads: It ignores participation completely.
It ignores participation completely. Illustrative chart - not real market data.

It sees price only. A swing made on heavy volume and one made on nothing are the same line, which is why it belongs alongside a participation check rather than instead of one.

A long-horizon candlestick view of the same price series. The headline on the chart reads: On a daily chart the same threshold finds different swings.
On a daily chart the same threshold finds different swings. Illustrative chart - not real market data.

A percentage threshold does not transfer across timeframes. 1% is a routine move on a daily chart and a large one on a five-minute chart, so the setting has to be chosen per timeframe.

A candlestick series containing several opening gaps, with the largest opening gap marked. The headline on the chart reads: A gap can confirm a pivot with no trading in between.
A gap can confirm a pivot with no trading in between. Illustrative chart - not real market data.

A gap can confirm a pivot instantly, and the leg drawn across it represents a distance nothing traded through.

A declining stretch of the long price series, with the entry price and the level at which a stop would trigger drawn as horizontal lines. The headline on the chart reads: It never tells you where the stop goes.
It never tells you where the stop goes. Illustrative chart - not real market data.

Its one direct trading use is a confirmed pivot as a stop reference. That works because the pivot is already settled — you are using the part of the tool that does not move.

A candlestick chart of the site's shared price history, annotated with the round-trip cost. The headline on the chart reads: And trading every pivot pays a share of a bar each time.
And trading every pivot pays a share of a bar each time. Illustrative chart - not real market data.

At the 0.5% setting, trading every pivot means 175 round trips on 576 bars. Each one costs 2% of a median bar’s range on this history, which is a large bill for a tool that confirms two bars late.

A 72-bar candlestick section of the shared price history. The headline on the chart reads: The swings are a drawing; the book has none of them.
The swings are a drawing; the book has none of them. Illustrative chart - not real market data.

The real job is upstream of trading. It is what turns a vague argument about whether the trend is intact into a reproducible statement: at this threshold, on this timeframe, the last three swing highs were these prices. That is worth having precisely because it stops you moving the goalposts once a position is open.

There is a second, quieter use worth naming: measuring your own market. Run the tool at two or three thresholds and record how many swings each produces, how long the median leg runs in bars, and how far it travels in price. Those three numbers describe the instrument’s rhythm better than any indicator reading, and they tell you whether a method expecting weekly swings has any chance on the timeframe you are watching.

They also change over time, which is the part that makes it worth repeating. A market that produced a 5-bar median leg last quarter and a 12-bar one this quarter has slowed down, and every stop distance and target built on the old rhythm is now mis-sized. Measuring it takes minutes and it is the kind of check almost nobody runs.

What the ZigZag indicator is not

It is not predictive. Every line it draws describes the past.

It is not repainting in the dishonest sense. The provisional leg is the definition working.

It is not a strategy. A backtest that buys its lows is reading the future.

And it is not objective. The threshold is a choice with large consequences.

When it fails

A sideways, range-bound candlestick series. The headline on the chart reads: In a range it draws and redraws the same two lines.
In a range it draws and redraws the same two lines. Illustrative chart - not real market data.

In a range it oscillates between the same two boundaries and produces a swing count that looks like structure while describing a market going nowhere.

The second failure is the backtest that trades it. Buying every zigzag low is buying with information that did not exist at the time, and the equity curve produced is fiction.

A third is a threshold chosen after looking. Tuning it until the swings match the story you already believe is curve fitting with extra steps.

A fourth is reading the last leg. It is the one part of the output that is not yet real.

And a fifth is using it as Elliott Wave confirmation. Two subjective tools agreeing is not corroboration; it is the same choice made twice.

The original data

On this site’s shared 576-bar history: a 0.5% threshold gives 175 pivots, one every 3 bars, median leg 2 bars and 1.212 price units. 1% gives 85 pivots, one every 7 bars, median leg 5 bars. 2% gives 32, one every 18 bars, median 13 bars. 3% gives 15, one every 38 bars, median 26 bars. The figures are in research/series-measurements.json, produced by site/measure_series.py.

A 72-bar window of the shared price history, cut short at the decision bar. The headline on the chart reads: The last leg has not confirmed. Trade it?
The last leg has not confirmed. Trade it? Illustrative chart - not real market data.

The eleven-fold spread in pivot count across four ordinary settings is the finding. It means two traders looking at the same chart with the same tool can honestly disagree about how many swings are in it, and neither is wrong. Pick one threshold per timeframe, write it in your plan, and do not change it because a position needs it to change — the value of the tool is entirely in the fact that the definition is fixed before you look.

Swing high and low is what the tool is filtering for. Market structure is what the filtered swings are used to describe. And Elliott Wave is the framework it most often gets attached to.

What I actually do

The zigzag is the tool I use to settle arguments with myself about what counts as a swing. It stops me redrawing structure to suit the position I already have. What it never does is tell me anything is about to happen, and the moment I catch myself looking at the last leg for a signal, I close it.

— Michael Whitman

This page is educational, not financial advice. Test every idea on your own charts before risking money.