Charts See the terminal

Zig Zag

Lines joining swing highs and lows that are at least a set percentage apart, so only the larger moves remain visible.

Live Zig Zag preview · BTC/USDT · Binance

What is Zig Zag?

Zig Zag draws straight lines between swing highs and swing lows, ignoring every move smaller than the deviation you set. What is left is the skeleton of the larger moves, which makes structure such as higher highs and lower lows easy to see.

It is a filter for reading structure, not a timing tool. Its most recent leg is provisional and changes as price moves, so it does not tell you where the current move will end.

How to use Zig Zag

  • Solid legs. Each solid line joins two confirmed swing points. These do not change once drawn.
  • The dashed leg. The dashed line runs from the last confirmed swing to the current extreme. It extends as price makes new highs or lows and can be replaced entirely.
  • Swing structure. A run of higher swing highs and higher swing lows describes an uptrend; lower ones a downtrend.
  • Leg sizes. Comparing the length of recent legs shows whether moves in the trend's direction are getting larger or smaller.

The confirmed legs describe the past. Do not read the dashed end as a finished swing.

Settings

SettingDefaultWhat it changes
Deviation (%)5 The minimum move, as a percentage, that confirms a swing and starts a new leg. Lower shows more, smaller swings; higher keeps only the largest. Minimum 0.001, maximum 100.
Depth10 The minimum number of bars between a swing extreme and the bar that confirms it. It stops several swings being marked inside one fast move. Minimum 1.

Adjust the deviation and depth in the indicator settings to suit the market's volatility and the timeframe.

Calculation

The indicator tracks one leg at a time, using bar highs and lows:

up leg:    a higher high moves the current swing high to that bar
           a drop of 5% or more from the swing high,
           at least 10 bars after it, confirms the swing high
           and starts a down leg
down leg:  the mirror image, using lows

When a swing is confirmed, a solid line is drawn from the previous confirmed swing to it. A dashed line runs from the last confirmed swing to the current extreme of the leg in progress, and is redrawn each bar.

The first leg starts as an up leg from the first bar's high. That starting direction is arbitrary and corrects itself at the first confirmed swing, so the first few bars of loaded history are not a reliable part of the picture.

The deviation alone does not prevent clusters: a volatile market can retrace 5% twice within three bars. Depth requires a minimum number of bars after each extreme before it can be confirmed.

Limitations

  • The last leg repaints. The current extreme is provisional and can be extended or replaced until price moves the deviation away from it.
  • Confirmation comes late. A swing is only confirmed after price has moved the full deviation away and the depth has passed, well after the actual turn.
  • It flatters hindsight. On history every swing looks perfectly placed. A strategy tested as if the turns were known at the time will look far better than it is.
  • Settings change the picture. The same chart shows very different swings at 3% and at 10%, and the right value depends on the market and timeframe.

Frequently asked questions

Zig Zag draws lines between swing highs and swing lows that are separated by at least a set percentage move, filtering out smaller fluctuations. It shows the shape of the larger moves on the chart.

Set the deviation so the swings it keeps are the ones you care about on your timeframe. The default of 5% suits higher timeframes; intraday charts often need a smaller value to show any swings. Depth, default 10 bars, stops several swings being marked inside one fast move. Test the settings on the market you trade.

Yes. The indicator declares two inputs: Deviation (%), default 5 with a range of 0.001 to 100, and Depth, default 10 with a minimum of 1. Open the indicator's settings on the chart to change them.

Yes, the last leg does, and this is built into how it works. A swing is only a swing once price has moved the deviation away from it, so the newest extreme is provisional: the dashed line extends as price makes new extremes and can be replaced if the retrace never comes. Confirmed legs, drawn solid, do not change. Because swings are confirmed well after the turn, a Zig Zag read on history shows turning points that were not known at the time.

It is better used to read structure than to time entries. Any rule that acts on a swing point must wait for that swing to be confirmed, which happens after price has already moved the full deviation away from it.

Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Zig Zag already applied. On any other market, open the indicator picker on the chart and choose Zig Zag from the Levels group.

Add to chart