QuantumAlgo
Home›Blog›Premium Guides›Indicators · Structure
Indicators · Structure

Zig Zag Indicator: How It Works, Settings, Repainting and How to Use It

Zig Zag Indicator: How It Works, Settings, Repainting and How to Use It — Quantum Algo guide
◆ THE SHORT ANSWER

The Zig Zag indicator connects swing highs and lows that are at least a set percentage apart — 5% is the traditional setting — and ignores smaller moves, giving a clean outline of the trend. It repaints by design: the last leg is provisional until price reverses by the full deviation. Use confirmed pivots to read structure, count waves and anchor Fibonacci levels, and time entries on confirmation, not on the last leg.

Every chart is full of swings that do not matter. The Zig Zag indicator removes them: it draws only the turning points separated by a minimum move, so the trend, its pullbacks and its structure become obvious at a glance. It is also one of the most misunderstood indicators, because its last line moves on live data and backtests built on it often cannot be traded. This guide covers how it is calculated, the settings on TradingView and MetaTrader, which deviation to use, why it repaints and how to use it properly — with a calculator.

Premium Indicators

Indicators that prove themselves in public.

One engine, four precision tools — the Gold (XAU) Scalper, the institutional Gravity Zone, the Zeno momentum Oscillator, and Zeno Stocks for equities.

Tap a side card, drag, or use the dots to switch
At a glance — the Zig Zag indicator in one minute
QuestionUseful answerWhat is it?Lines between swing highs and lows at least X% apart.Typical setting?5% deviation; scale it to the market and timeframe.Does it repaint?Yes — the last leg is provisional until confirmed.Best use?Reading structure, counting waves, anchoring Fibonacci.
◆ Real charts · Zeno on gold, Bitcoin and NAS1001 / 3
◆ Real chart · XAUUSD · 15M · Quantum Algo Zeno Gold
Quantum Algo Zeno Gold on XAUUSD 15-minute chart: long and short signals with take-profit and stop-loss zones and the dashboard showing margin, TP1, TP2 and Smart Entry status
What every indicator on this page is a filter for: Zeno on gold marks the location — sweep, order block, entry, stop, TP1/TP2. The oscillator decides when.
Swipe or use the arrows · 3 real charts

What is the Zig Zag indicator?

The Zig Zag indicator draws straight lines between swing highs and swing lows that are at least a set percentage apart, and ignores every price move smaller than that. Set it to 5% and it connects only turning points separated by moves of 5% or more; every pullback under 5% disappears inside the leg. The result is a clean outline of the trend — the swings, without the noise.

Two properties define it. It is a filter, not a forecast: it draws its lines on hindsight and has no predictive power on its own. And its last leg is provisional: the most recent line keeps extending or can be redrawn until price reverses by the full deviation, so the Zig Zag repaints on live data. Used with that in mind, it is one of the most useful tools for seeing market structure, counting waves and measuring swings. Its idea goes back to Arthur Merrill's 1977 book Filtered Waves.

◆ Chart · filtering swings
A candlestick chart on a dark background with a white zig zag line joining swing highs and swing lows, small pullbacks inside the legs labelled move under five percent ignored, and the turning points labelled pivot high and pivot low
The Zig Zag connects swing highs and lows that are at least a set percentage apart and ignores everything smaller. With a 5% setting, any pullback under 5% is treated as noise inside the leg.

How is the Zig Zag calculated?

  1. Start from a point. The first price in the data, or the first confirmed pivot.
  2. Track the extreme. In an up-leg, keep recording each new high; in a down-leg, each new low.
  3. Wait for the reversal. When price retraces from the extreme by at least the deviation — for example 5% — the extreme becomes a confirmed pivot.
  4. Start the next leg. Track the new extreme in the opposite direction from the pivot.
  5. Repeat. The chain of pivots is the Zig Zag; the leg from the last pivot to the current extreme is provisional.

On line charts the calculation uses closing prices; on bar and candlestick charts most platforms use the highs and lows, which produces larger swings. Some versions add a minimum number of bars between pivots, which filters by time as well as by size. In practice the settings differ by platform:

What are the Zig Zag settings on TradingView and MetaTrader?

PlatformInputsDefaults
TradingView (built-in Zig Zag)Reversal price deviation (%), pivot legs (bars to confirm a pivot), extend to last bar, display reversal price, cumulative volume and price changeDeviation 5%, pivot legs 10 (per published source code)
MetaTrader 4/5 (ZigZag)Depth (bars), Deviation (points, not percent), Backstep (bars)Depth 12, Deviation 5, Backstep 3
StockChartsPercentage5% traditional

The two big platforms filter differently. TradingView's version combines a percentage deviation with pivot legs — the number of bars on each side needed to confirm a high or low — so a pivot needs both a large enough move and enough bars around it. MetaTrader's classic ZigZag uses Depth (the minimum bars between pivots), Deviation measured in points rather than percent, and Backstep (bars before a new pivot can replace the previous one). Copying a "5" from one platform to the other does not give the same lines.

Which Zig Zag deviation should you use?

◆ Chart · three settings compared
The same price series shown in three stacked panels with zig zag lines, the top panel labelled deviation 3 percent with many swings, the middle panel labelled deviation 5 percent with fewer swings and the bottom panel labelled deviation 10 percent with only the largest swings
One chart, three settings. A lower deviation draws every minor swing; a higher one keeps only the large legs. The right setting depends on the timeframe and the swings you trade.
UseTimeframeStarting deviation
Intraday structure (indices, forex)5–15 minute0.3%–1% (or ATR-based)
Swing trading stocksDaily5%–8%
Crypto swings4-hour to daily5%–10%
Major trend legs / Elliott countingDaily to weekly10%–20%

There is no correct setting; there is the swing size you trade. A lower deviation draws every minor swing and is useful for intraday structure; a higher one keeps only the legs that matter for swing or position trading. Because volatility differs by market, a percentage that works on a stock index is too tight for an altcoin and too loose for EURUSD. Two practical methods: set the deviation to roughly the size of the pullbacks you would ignore while holding a trade, or tie it to volatility — a multiple of the ATR as a percentage of price.

Quantum Algo
QuantumBot

Automate your trades. Let Quantum Algo trade for you.

Every signal executed on your own account — on your account, with the plan you define.

Automate now →$199/mo · your keys, your funds
Live track recordTradingView
75%▲ 2.3:1 planned R:R
Win rate · 160 closed signals
5
Exchanges
400+
Pairs
<50ms
Fills

Does the Zig Zag indicator repaint?

◆ Chart · the provisional last leg
A zig zag line on a price chart where the earlier legs are solid and labelled confirmed, and the last leg is dashed and shown in two positions, an earlier faded one and the current bright one, with the label last leg moves until the next pivot confirms
Why the Zig Zag repaints: the last leg is provisional. It extends as price makes new extremes and can be redrawn until a reversal of the full deviation confirms the pivot. Only the earlier legs are fixed.

Yes — by design. The last line always runs from the most recent confirmed pivot to the current extreme. While price keeps making new extremes in that direction, the line extends. If price reverses by less than the deviation and then resumes, the line simply continues. Only when price reverses by the full deviation does the extreme become a confirmed pivot — and on platforms with pivot legs, only after enough bars have printed on the right side. TradingView's help states it directly: the latest line is not final.

That has two consequences. A Zig Zag never tells you that a swing has ended in real time; it tells you after the reversal has already travelled the deviation. And backtests that read Zig Zag pivots as if they were known at the turning point produce results that are impossible to trade. Use confirmed pivots for analysis and plan entries on confirmation, not on the provisional leg.

How do traders use the Zig Zag indicator?

UseHowWatch out for
Market structureRead higher highs and higher lows, or lower highs and lower lows, from the pivotsThe last pivot is provisional
Elliott Wave countingUse a deviation that isolates the waves at the degree you countDifferent settings give different counts
Chart patternsPivots outline double tops, head and shoulders, triangles and harmonicsPatterns drawn on the provisional leg can vanish
FibonacciMeasure retracements and extensions between confirmed pivotsAnchor only to confirmed swings
Support and resistancePivot prices mark swing levelsCombine with liquidity and volume

The most common practical use is as a structure map. With a sensible deviation, the pivots show the sequence of swing points that define trend: higher highs and higher lows in an uptrend, the first lower high as a warning, and a break of the last higher low as a market structure shift. For Elliott Wave traders the Zig Zag removes subjectivity in where waves start and end; for harmonic and Fibonacci traders it gives consistent anchor points.

Is there a Zig Zag trading strategy?

  1. Define trend from the confirmed pivots. Two higher highs and higher lows for an uptrend.
  2. Wait for a pullback into the previous swing area. The zone between the last confirmed high and the Fibonacci 50%–61.8% of the leg.
  3. Wait for confirmation. A lower-timeframe structure shift or a reaction candle — not the provisional Zig Zag leg.
  4. Place the stop beyond the last confirmed pivot. If price breaks it, the structure the trade relied on is gone.
  5. Target the next swing. The previous high, or a Fibonacci extension of the leg.

This is a structure strategy that uses the Zig Zag for the map, not for the trigger. Strategies that buy when a new Zig Zag low prints look excellent on historical charts and fail live, because on live data the low is only confirmed after price has already risen by the full deviation.

Zig Zag calculator

Paste a series of prices — closes from any chart — and choose a deviation. The calculator walks the series exactly as the indicator does and returns the confirmed pivots, each leg's size and the provisional last leg, so you can see which swings a given setting keeps and why the last one is not final. The sample prices are illustrative.

ZIG ZAG CALCULATORA list of prices and a deviation % → the confirmed swing highs and lows, each leg's size and the provisional last leg
Reading——
Quantum Algo

Reference data

ItemValue
DefinitionLines between swing highs and lows at least X% apart
Traditional setting5%
Repaints?Yes — the last leg is provisional
OriginArthur Merrill, Filtered Waves (1977)
TradingView inputsDeviation %, pivot legs, extend to last bar, labels
TradingView defaultsDeviation 5%, pivot legs 10 (published source)
MetaTrader inputsDepth, Deviation (points), Backstep
MetaTrader defaults12, 5, 3
Prices usedCloses on line charts; highs and lows on bar and candle charts
Main usesStructure, Elliott Wave, patterns, Fibonacci anchors

Worked example: what a 5% Zig Zag keeps

Take the calculator's sample series, which rises from 100 to 110, falls to 98, rallies to 115 and dips to 107. With a 5% deviation the first pivot is the start at 100; the rally to 110 is confirmed as a swing high when price falls to 104.5 or below (it reaches 103), the fall to 98 is confirmed as a swing low when price recovers to 102.9 (it reaches 106), and the rally to 115 becomes a swing high when price drops to 109.25 (it reaches 107). The legs are +10%, −10.9% and +17.3%; the small dip from 107 to 105 inside the first rally and the bounce to 104 inside the decline are ignored.

At the last bar, price is 108 — the leg from 115 down to 107 is provisional. If price rose back above 115, that line would be redrawn as part of a longer up-leg; if it fell further, the line would extend. Change the deviation to 3% and the small swings reappear; change it to 10% and only the larger legs remain. That is the whole indicator in one exercise.

What mistakes do traders make with the Zig Zag indicator?

  • Trading the provisional leg. The last line can extend or be redrawn; it is not a signal.
  • Backtesting on repainted pivots. Results that assume pivots were known at the turn cannot be repeated live.
  • One setting for every market. Volatility differs; scale the deviation to the instrument and timeframe.
  • Copying settings across platforms. MetaTrader's deviation is in points and TradingView's in percent, with different confirmation logic.
  • Forcing pattern counts. Changing the deviation until a pattern appears is curve-fitting.
  • Using it alone. It shows structure; it does not show liquidity, volume or confirmation.

How does the Zig Zag fit with structure and the free indicators?

The Zig Zag is a way of seeing swings; the trading decisions come from what price does at them. The useful combination is confirmed swing structure plus a reason to act: a liquidity sweep of a prior pivot followed by a shift in structure, a retest of a broken swing level, or a reaction at a Fibonacci zone between confirmed pivots. The swing points, trendline trading and support and resistance guides cover those decisions.

On TradingView the free Quantum Algo indicators mark swing structure, liquidity and key levels automatically, without the repainting last leg of a classic Zig Zag; Zeno, the premium engine, prints its own buy and sell signals with an entry, a stop and two targets, and the public track record lists every call.

◆ Key takeaways

The Zig Zag indicator filters out swings smaller than a chosen percentage so the trend's structure is easy to read. Its last leg is provisional and repaints, so use confirmed pivots for analysis — structure, Elliott Wave, patterns and Fibonacci anchors — and take entries on confirmation. Scale the deviation to the market and timeframe, and remember MetaTrader and TradingView define it differently.

◆ Interactive check

Do you understand the Zig Zag indicator?

Questions traders ask about the Zig Zag indicator

What is the Zig Zag indicator?+

An indicator that draws lines between swing highs and swing lows that are at least a set percentage apart and ignores smaller moves, so the trend's structure is easy to see.

What is the best Zig Zag setting?+

There is no single best. 5% is traditional; intraday traders use much smaller values or an ATR-based setting, and position traders 10% or more. Set it to the size of the pullbacks you would ignore while holding a trade.

Does the Zig Zag indicator repaint?+

Yes. The last line runs from the latest confirmed pivot to the current extreme and can extend or be redrawn until price reverses by the full deviation. Earlier legs do not change.

How do you use the Zig Zag on TradingView?+

Add the built-in Zig Zag, set the reversal price deviation (%) and the pivot legs, and optionally display the reversal prices and price changes. Read structure from the confirmed pivots.

What are the MT4 Zig Zag settings?+

Depth 12, Deviation 5 and Backstep 3 by default. Depth is the minimum bars between pivots, Deviation is in points, and Backstep is the bars before a new pivot can replace the previous one.

Is the Zig Zag indicator good for Elliott Wave?+

Yes — it is widely used to mark wave starts and ends consistently. Choose a deviation that matches the degree you are counting, and do not change it until a count appears.

Can you trade with the Zig Zag indicator?+

Use it as a map, not a trigger: define trend from confirmed pivots, wait for a pullback and a confirmation, stop beyond the last confirmed pivot and target the next swing.

Why does my Zig Zag look different on different platforms?+

TradingView combines a percentage with pivot legs, MetaTrader uses depth, deviation in points and backstep, and some versions use closes rather than highs and lows.

Who invented the Zig Zag indicator?+

Its idea is credited to Arthur Merrill's 1977 book Filtered Waves, which filtered price swings by a minimum percentage.

Is there a non-repainting Zig Zag?+

Versions that only plot pivots after they are confirmed do not change past lines, but they appear with a delay. The delay is the price of not repainting.

References & Related Guides

Read next

Primary sources

Writer · Quantum Algo

ILY writes trading education for Quantum Algo — breaking down smart money concepts, market structure, and price action into clear, practical lessons. Every guide is reviewed by Quant, the founder, and every trade idea Quantum Algo publishes is timestamped so anyone can verify it.

✓ Reviewed by Quant · Founder & Head Trader