ZigZag Indicator
By Chad Smith, Director of Research & Analysis · Updated
On this page
The ZigZag indicator connects significant swing highs and swing lows on a price chart with straight lines. It ignores any move smaller than a chosen threshold, so only the meaningful swings remain. The result is a clean outline of market structure: higher highs and higher lows in an uptrend, lower highs and lower lows in a downtrend. It is a tool for analysis rather than for live signals, because its last line can change.
What it measures
ZigZag measures swing structure. It answers the question: setting aside small moves, where did the market make its real turns?
The threshold decides what counts as "real". With a 5% setting, a turn only registers once price has reversed by at least 5% from the last swing point. Smaller wiggles are absorbed into the current line. A larger setting gives fewer, bigger swings; a smaller setting gives more, smaller ones.
ZigZag does not average prices. It connects actual highs and lows, so its points sit exactly on real price extremes.
The formula
ZigZag is defined by rules rather than a single equation.
Percentage method:
1. Start from a swing point (high or low).
2. Track price in the current direction, updating the extreme.
3. When price reverses from that extreme by at least the threshold (X%),
confirm the extreme as a swing point and start a new line
in the opposite direction.
Reversal test for a swing high H: price ≤ H × (1 − X/100)
Reversal test for a swing low L: price ≥ L × (1 + X/100)
Depth / deviation / backstep method (common on some platforms):
Depth = minimum number of bars between swing points (default 12)
Deviation = minimum move, in points, to form a new swing (default 5)
Backstep = minimum bars between consecutive highs or lows (default 3)
Worked example (illustrative numbers). With a 5% threshold, price rises from a swing low of 100 to 120. The current extreme is 120. Price dips to 116, which is only a 3.3% pullback, so nothing changes. Price then falls to 113.5. That is 5.4% below 120, so 120 is confirmed as a swing high and a new line begins down from it. If price later rises 5% from its new low, that low is confirmed and the next line begins.
Default settings
| Method | Common defaults |
|---|---|
| Percentage | Often around 5% on daily stock charts; much smaller on forex |
| Depth / deviation / backstep | 12 / 5 / 3 |
Settings must match the market and timeframe. A 5% threshold on a currency pair's hourly chart would show almost no swings. The ZigZag indicator is built into MetaTrader and TradingView.
How to read it
Trend structure. A series of higher swing highs and higher swing lows marks an uptrend. Lower highs and lower lows mark a downtrend. A mix shows a range.
Swing size. The length of each line shows how far price moved between turns. Comparing swing lengths shows whether trend legs are growing or shrinking.
Pattern recognition. ZigZag makes chart patterns easier to spot, such as head and shoulders, double tops and triangles, because noise is removed.
The last line. The most recent line is provisional. It extends with each new extreme and can be redrawn or removed if price does not reverse by the threshold. Only earlier lines are fixed.
ZigZag vs fractals and pivot points
Fractals also mark swing points, but use a fixed number of bars on each side, usually two. They mark many small swings and, once confirmed, never change. ZigZag uses a minimum price move, marks fewer swings and can change its last line.
Pivot points are calculated levels from the prior session, not swing points from the chart.
Fibonacci retracement and Fibonacci extension need swing points to anchor them. ZigZag is often used to choose those points objectively, so different traders using the same threshold get the same anchors.
Common strategies
Structure analysis
Use ZigZag to label swing highs and lows and judge trend direction. Trade only in the direction the structure shows, using other tools for entries.
Anchoring Fibonacci tools
Draw Fibonacci retracements from the last confirmed ZigZag low to high (or high to low). This reduces the subjectivity of choosing anchor points.
Measuring swing size
Compare the length of recent ZigZag legs to set realistic targets. If recent swings have averaged a certain size, a target far beyond that may be optimistic.
Elliott Wave counting
Analysts who use Elliott Wave theory often use ZigZag to outline waves, since it shows the main swings without small fluctuations.
Studying past behavior
ZigZag is well suited to reviewing history. A trader can scroll back and see how deep pullbacks typically were in past trends, or how long ranges lasted before a breakout. That review builds a sense of what is normal for a market, which helps when judging live price action with tools that do not repaint.
Weaknesses
ZigZag repaints. The last line changes as new data arrives, and a swing that looked confirmed can extend. Any strategy that uses the latest ZigZag point as a live signal will look far better on historical charts than in real time.
It is hindsight-based. Swing points are only confirmed after price has moved by the threshold, so they always appear late.
The threshold is subjective. Different settings produce very different structures on the same chart.
It gives no momentum, volume or volatility information. It is purely a structural outline.
Indicators it pairs with
- Fibonacci retracement and extension, anchored on ZigZag swings.
- Fractals, for non-repainting swing points.
- RSI or MACD, to compare momentum at each ZigZag swing and spot divergence.
- ATR, to set a ZigZag threshold that suits current volatility.
- Moving averages, for a live trend view that does not repaint.
For more on swing structure and trends, see the technical analysis course.
Brokers with strong charting to practice on
Put this into practice on a demo account first, with no money at risk.
- Featured broker
Pepperstone4.7 / 5Visit
IC Markets4.9 / 5Visit
GO Markets4.8 / 5Visit
Frequently asked questions
What does the ZigZag indicator do?
It draws straight lines between significant swing highs and swing lows, ignoring price moves smaller than a chosen threshold. This makes the main swings and trend structure easier to see.
Does the ZigZag indicator repaint?
Yes. The last line can change as new prices arrive, because the latest swing is not final until price reverses by the threshold amount.
What settings does ZigZag use?
Some platforms use a single percentage threshold that sets the minimum reversal. Others use depth, deviation and backstep inputs, commonly set to 12, 5 and 3.
Can ZigZag be used as a trading signal?
It is not suitable as a direct signal because of repainting. It is better used to study structure, measure swings and anchor other tools.
How is ZigZag different from fractals?
Fractals mark swing points using a fixed bar count and never change once confirmed. ZigZag uses a minimum price move and its latest line can change.