Levels & geometry

ZigZag · ZigZag

A filter that connects only the significant swing highs and lows, stripping out moves smaller than a set threshold.

Works in most conditionsEngine-computed on a fixed sample series
14512096

The formula

ZigZag tracks the running extreme — a swing high or low — and draws a new leg only when price reverses from it by at least the threshold. Smaller wiggles are ignored, so the line keeps only the meaningful swings. The current leg stays provisional and repaints until a fresh pivot clears the threshold.

Reversal % = |Price − last extreme| ÷ last extreme × 100 ; new leg only when Reversal % ≥ threshold
Worked example
EventPriceReversal from highNew leg?
Swing high100
Dip964%No
Dip946%Yes

A 5% ZigZag ignores the 4% dip and confirms a down-leg only at 94 (6%)

What it is

ZigZag is not a signal generator but a filter that cleans a price chart down to its meaningful swings, drawing straight lines that connect only the significant highs and lows and ignoring every wiggle smaller than a threshold you set. Its purpose is visual clarity: by stripping out the small back-and-forth noise, it exposes the underlying wave structure of a market so you can see the real swing highs and swing lows at a glance. The question it answers is which turning points actually matter, given how large a move you consider significant. It is crucial to understand from the outset that ZigZag repaints, meaning its most recent leg is provisional and can extend or disappear as new prices arrive, so it never predicts a turn, it only confirms one after the fact. For a beginner, picture connecting only the important peaks and valleys of a mountain range with straight lines while ignoring every pebble, and you have the essence of ZigZag.

How it is calculated

ZigZag works from a single sensitivity threshold, most often a percentage such as five percent, though it can instead use a fixed number of points or a multiple of the Average True Range. Starting from a pivot, it tracks price in the current direction and keeps extending the leg as long as price continues that way. It only registers a reversal, and draws a new leg in the opposite direction, once price has retraced by at least the threshold amount from the most recent extreme. Moves smaller than the threshold are simply ignored, which is what filters out the noise. Once a reversal of sufficient size is confirmed, the prior extreme becomes a fixed pivot and a straight line is anchored to it, but the newest leg remains unconfirmed until price either continues far enough to lock it in or reverses by the threshold and cancels it. This threshold-driven logic is why the tool lags: a pivot cannot be fixed until price has already traveled the required distance away from it.

Reading it, step by step

Read the completed portion of the ZigZag as confirmed market structure: each fixed pivot is a genuine swing high or swing low that satisfied your significance threshold, and the alternating pivots lay out the sequence of higher highs and higher lows, or lower highs and lower lows, that define the trend. The single most important discipline is to treat only the finished legs as real and to regard the current, most recent leg as provisional, because it will redraw if price keeps moving. Never read the last line as a signal or as a prediction of the next turn; it is a moving placeholder, not a forecast. Use the confirmed swings to measure the size and rhythm of the market's moves and to locate the exact prices of past reversals. The clean structure it reveals is the raw material for other analysis, not a trade trigger in itself.

Best timeframes

  • Scalping1m – 5msmall % threshold
  • Day trading5m – 1h
  • Swing4h – daily5% is common
  • Positiondaily – weeklylarger threshold

Pick the threshold to match the instrument's typical swing size, not the timeframe alone.

ZigZag vs other swing filters

ZigZagFractalsRenko
Filters noiseYesPartlyYes
RepaintsYes (last leg)NoNo
Marks swingsYesYesVia bricks
A trade triggerNoMaybeYes

Common price-action setups

How the signal typically plays out on the chart.

Confirmed swing for a Fib entry

Anchor a Fibonacci retracement to the last confirmed ZigZag up-leg and buy a pullback that holds the 61.8% level with a stop below the swing low. The ZigZag defines the leg; the Fib times the entry.

Buy the retrace
Trend continuation
Double-top breakdown

When ZigZag prints two swing highs at a similar level, a break of the intervening low confirms a double top; short the breakdown with a stop above the highs.

Sell neckline
Reversal lower
Higher-low structure break

Use the confirmed ZigZag pivots to read structure — a fresh higher low followed by a break of the prior swing high signals continuation; enter on the break with a stop under the higher low.

Buy the break
Uptrend continues

Best timeframes and settings

The key parameter is the reversal threshold, and five percent is a common default, but the right value depends entirely on the instrument's volatility and your timeframe. A small threshold captures many minor swings and clutters the chart, which suits short-term analysis on quiet instruments, while a large threshold shows only major structural turns, which suits long-term charts and volatile assets. On a highly volatile market like crypto you would widen the threshold so that ordinary daily noise does not register as a swing, whereas on a placid instrument a smaller threshold reveals useful structure. ZigZag can be applied on any timeframe, from intraday to monthly, because it simply adapts to whatever price series it is given. The trade-off is between detail and clarity: too small a threshold buries the structure in noise, too large a one hides swings you may care about, so you tune it until the picture matches the scale of moves you actually trade.

When and where to use it

ZigZag is best used as a preparation and analysis tool rather than an execution tool, and it fits any regime because it is simply describing structure, not calling direction. It is invaluable when you want to place Fibonacci retracements accurately, since it pinpoints the exact swing high and swing low to anchor them between. It is equally useful for counting Elliott waves, for identifying chart patterns such as double tops and bottoms or head-and-shoulders formations, and for teaching yourself to see the swing structure hidden in noisy price action. It works across all asset classes because volatility is handled by the threshold setting. Where you must not use it is as a live trade trigger, because its repainting last leg makes any signal read off the current line an illusion; the trade decision must always come from the overlays you build on top of the confirmed swings.

Strategies that use it

The first application is Fibonacci retracement placement: use ZigZag to identify a confirmed swing high and swing low, anchor a retracement between them, and then plan entries at the retracement levels, letting the Fibonacci overlay rather than the ZigZag line generate the actual signal. The second is pattern recognition: let the clean swings reveal formations such as double tops, double bottoms, or head-and-shoulders, and trade the pattern's own rules, such as a break of the neckline, with the ZigZag having done nothing more than make the pattern visible. The third is Elliott wave and swing analysis, where the confirmed pivots help you label the impulsive and corrective waves and then trade according to wave-count expectations. In every one of these, ZigZag is strictly the preparation layer; the entries, stops, and targets come from the structural tools laid over its swings, never from the repainting line itself.

Combining it with other indicators

ZigZag combines most naturally with Fibonacci retracements and extensions, which need precise swing anchors that the tool provides, and with manual trendlines drawn between its confirmed pivots. It supports classical support-and-resistance analysis by marking the exact swing highs and lows that become horizontal levels. It underpins Elliott wave counting and Gann analysis, both of which depend on identifying significant turning points cleanly. It also pairs with momentum oscillators for divergence analysis, since you can compare the oscillator's peaks against the price peaks that ZigZag has clearly marked. What it should never be paired with is a mechanical entry system that reads its live leg, because that leg repaints; the correct combination always treats ZigZag as the structural scaffold and lets a non-repainting tool make the actual timing decision.

Where it fails

The most dangerous failure is a misunderstanding rather than a market event: because the finished legs never move once fixed, a ZigZag chart of the past looks as though it perfectly caught every top and bottom, fooling newcomers into believing it predicts turns, when in reality its live leg was repainting the whole time. It also lags by construction, since a pivot cannot be confirmed until price has already traveled the threshold distance away from it, so you always learn of a swing after it has meaningfully reversed. Setting the threshold too small buries the structure in noise, while setting it too large hides swings you needed to see. The overriding mistake is trying to trade the current leg as a signal. The defenses are to internalize that ZigZag is a lagging, repainting descriptive tool, to use only its confirmed pivots, to tune the threshold to the instrument, and to draw every actual trade decision from the overlays you build on the finished swings.

A worked example

Suppose you set the ZigZag threshold to five percent on a stock that rallies from 100 up to 120. As long as price keeps rising, the up leg simply extends toward 120, and no pivot is fixed yet. Price then peaks at 120 and starts to fall, but the pivot at 120 is not confirmed until the decline reaches at least five percent, that is until price drops to 114; only then does ZigZag lock in 120 as a swing high and begin drawing a down leg. Price continues down to 105, a fall of roughly twelve percent from the peak, and that low will similarly be confirmed as a swing low once price rebounds five percent, to about 110.25. At that moment your confirmed structure reads 100 up to 120 down to 105, three clean pivots you can anchor a Fibonacci retracement to, but the fresh leg rising off 105 is still provisional and will vanish or extend depending on what price does next. If instead the bounce off 105 had failed before reaching the five percent threshold and price had made a new low, the tentative up leg would simply disappear, which is exactly the repainting behavior you must never trade against.

Common mistakes

  • Believing the final leg predicts a turn — it repaints and can vanish as price moves.
  • Trading the ZigZag line itself instead of the structure and overlays built on it.
  • Backtesting off ZigZag pivots and fooling yourself with hindsight the line could not have known live.
  • Setting the threshold too small, so noise creates dozens of meaningless legs.
  • Forgetting a pivot only fixes once price has moved far enough — the signal lags.
  • Treating a fresh, unconfirmed leg as a confirmed swing high or low.