What the ZigZag indicator is
The ZigZag indicator draws straight lines between significant swing highs and swing lows on a chart. It ignores price moves smaller than a threshold you set. The result is a cleaner view of how the market has moved, without the noise of every candle.
ZigZag does not predict anything. It describes swings that have already happened. On the latest swing, it keeps changing its mind (see below).
Ready to try it on a real or demo account?
Partner link · trading carries a high risk of loss
A drawn example
- A to B is an up swing. B to x is a down swing.
- The small bounce near x was below the threshold, so ZigZag skipped it.
- C, D and E connect the later swings.
- The leg from D to E is not final. If price keeps falling, E moves lower. If price turns sharply, ZigZag may delete E and redraw the line from D.
How it is calculated
The logic of the standard MetaTrader version:
- Look back over a set number of bars and find the highest high and lowest low.
- Accept a new swing point only if price has moved by more than a minimum deviation from the last point.
- Skip a new point if it comes too soon after the previous one in the opposite direction.
- Connect the accepted points with straight lines.
ZigZag indicator settings
The standard MetaTrader ZigZag has these inputs:
| Setting | What it controls | Raise it | Lower it |
|---|---|---|---|
| Depth | Bars scanned for a swing high or low | Fewer, larger swings | More, smaller swings |
| Deviation | Minimum move, in points, before a new swing counts | Filters small moves | Shows minor swings |
| Backstep | Minimum bars between consecutive swing points | Fewer quick reversals | More frequent points |
The default values are shown in the indicator's input window. Many traders keep the defaults on the higher timeframes and raise Depth or Deviation on lower ones, where noise is greater. Deviation is measured in points, so a value that suits a currency pair may be far too small or too large for gold or an index. Check the setting whenever you switch instruments.
How to add it in MT4 and MT5
In most builds of MetaTrader 4, ZigZag is under Insert, then Indicators, then Custom. In MetaTrader 5 it usually sits under Insert, then Indicators, then Examples. You can also drag it from the Navigator window onto the chart. The exact menu can differ by build. See our MetaTrader 4 and MetaTrader 5 pages for platform basics.
How to read it and typical uses
- Market structure: higher highs and higher lows suggest an uptrend. Lower highs and lower lows suggest a downtrend. See market structure.
- Fibonacci anchors: ZigZag points give consistent swing points for Fibonacci retracement and Fibonacci extension.
- Pattern counting: it helps with Elliott Wave counts and harmonic patterns.
- Levels: past swing points mark candidate support and resistance zones.
- Divergence: comparing ZigZag swings with an oscillator makes divergence easier to spot.
A "zigzag strategy" usually means one of these uses combined with other tools. The line alone is not a trading signal.
Where ZigZag misleads
- Repainting: the last leg is redrawn as new bars form. A swing high you saw an hour ago may disappear. See repainting indicators.
- Backtesting: on history, every swing looks perfect because it is already confirmed. Any test that reads ZigZag points before they were confirmed overstates results.
- Lag: a swing is confirmed only after price has already moved away by the deviation amount, so the turn is late by design.
- Ranges: in sideways markets, small settings produce many meaningless swings.
- Gaps and spikes: a single spike can create a swing point that later price never respects.
The Fractals indicator is a related tool. It also marks swings but confirms them after a fixed number of bars.
Leveraged forex and CFD trading can lose money fast. Practise reading ZigZag on a demo chart before relying on it, and read our risk management guide.
Frequent questions
Does the ZigZag indicator repaint?
Yes. The most recent leg changes until the next swing is confirmed. Confirmed earlier swings normally stay fixed.
What are the best ZigZag indicator settings?
No setting suits every market. Larger values show major swings, smaller values show minor ones. Adjust Deviation for each instrument's price scale.
Is ZigZag useful for forex?
It is widely used on forex charts to map swings and structure. It describes the past and does not forecast price.
Can I build an automated strategy on ZigZag?
Only if the code uses confirmed swing points. Reading the unconfirmed last point gives results that cannot be repeated in live trading.
