How to Use the Zig Zag Indicator to Locate Trends and Waves

We all know that when looking at a chart it can be difficult to pinpoint precisely when a trend is turning, even in hindsight. Most chart indicators work on averages and a by-product of this is that they smooth away valuable information.

This loss of information means we won’t always see price swings and waves that may present excellent trading opportunities.

Using zig zag
Using zig zag © forexop

The zig zag filter aims to overcome these limitations. It does not smooth price and therefore it does not erode away useful information. Instead it uses an algorithm to pin point the exact places that the market is turning.

The zig zag can be used in a range of different scenarios. The output is a series of connected straight lines that connect recent low to highs. This makes it far more effective at identifying peaks and troughs than conventional smoothing filters like EMA and SMA. It also makes the zig zag an ideal tool for algorithmic trading.

Zig Zag versus Simple Moving Average

The power of the zig zag indicator is in its ability to cut through market noise and locate chart turning points. These are where trends are turning from one direction to another and aggregate price rises turn to price falls and vice versa.

Figure 1: Zig zag versus simple moving average - SMA-20
Figure 1: Zig zag versus simple moving average - SMA-20 © forexop

The chart in Figure 1 compares the zig zag detector to the simple moving average line, here SMA-20.

The first and most obvious difference between the two tools is in the location of the peaks and troughs.

While the moving average smooths out the extreme highs and the lows, it also erodes away much of the finer detail. The result of this is that it responds slowly to changes in price and this produces a delay. In other words the moving average appears to lag behind the real changes that are happening in the market.  It blurs away the precise location of the peaks and troughs and these get shifted further to the right, or later in time.

On the other hand, the zig zag appears to respond instantaneously. The peaks and troughs line up precisely with what we would instinctively call the turning points.

From this we can easily identify, 7 peaks and 7 troughs from the chart in Figure 1.


Another useful trait of the zig zag tool is the ability to change the resolution or scale of features that are detected. This is desirable for example when you want to look at a trend over longer periods of time. In this case, the minor waves won’t be of interest but rather it’s the overall path of the market that matters.

Figure 2: Zig zag at different resolutions
Figure 2: Zig zag at different resolutions © forexop

Take the chart in Figure 2. This demonstrates the zig zag filter at two different scale settings. The blue line displays the filter at a course-setting with depth=55.

The blue line marks the chart as one peak and two troughs. Notice how all of the fine detail in between is ignored.

On the other hand the red line shows the filter at a finer detail with a depth setting of 12. The red line marks out the peaks and troughs of most of the smaller waves in between those detected by the blue, courser filter.

Limitations of the Zig Zag

Unfortunately, the zig zag algorithm doesn’t possess any magic. It can’t foresee into the future and tell you precisely when the market is about to shift direction.

What it does do is introduce a delay of a few bars, before it commits to drawing the last line on the chart. This means that the indicator always back draws (or repaints) into the past. The newest line on the chart updates until the algorithm decides that the market has hit a new pivot point. And at that point it commits and fixes the line and then starts drawing a new one.

This means that the newest line on the chart will move around until the algorithm is sure that the market has reached a turn rather than a minor price correction.

When you use a courser scale, like the blue line in Figure 2, the consequence is that it’s then necessary to wait a long time before each turning point is finally committed.

The Zig Zag Indicator and Elliott Wave Theory

Elliott wave theory says that markets frequently trend in waves of ascent and descent and that these price movements can be predicted to some extent.

Figure 3: Elliott waves
Figure 3: Elliott waves © forexop

The biggest challenge though with Elliott theory is in defining where the waves start and where they end.

If you ask two different chart analysts you’ll hardly ever get the same answer because the interpretation of waves is so subjective. Not only that, in hindsight we can always re-interpret the wave positions to get any answer we want, and therefore validate a trading rule that may not have any real basis.

This is where zig zag comes in. The algorithm uses a systematic approach to detect peaks and troughs and this gives a more solid basis to any strategy working on the Elliott wave principle.


Carry Trading

Complete course

Carry trading has the potential to generate cash flow over the long term. This ebook explains step by step how to create your own carry trading strategy. It explains the basics to advanced concepts such as hedging and arbitrage.

Just add your email address below and get updates to your inbox.
1 Comment
  1. Zig Zag method is simple and anyone with basic knowledge of studying a graph can conceive results from it. But, I won’t recommend it at all to be used as basic tool to foresee future opportunities. Though, the algorithm Zig Zag method utilizes is flawless, it is perfect for a real time strategy formation.

Leave a Reply