Skip to Content

ZigZag

ZigZag is a broken line that connects notable highs and lows of the price and drops the small fluctuations between them. It makes the waves of a move and the levels of past reversals easy to see.

The indicator is drawn over the price chart.

How it is calculated

The indicator is built from bar highs and lows, like ZigZag in MetaTrader:

  1. A bar becomes a peak candidate if its high is the highest of the last Depth bars, and a trough candidate if its low is the lowest of the last Depth bars.
  2. When the highest high of Depth bars changes and the current bar’s high is no more than Deviation chart price steps (without a coarser price — ticks) below it, lower peak candidates among the previous Backstep bars are removed. Troughs work the same way with lows.
  3. Of several peaks in a row with no trough between them, the highest one stays; of several troughs in a row, the lowest one.
  4. Adjacent peaks and troughs are connected with segments.

There is no line after the last peak or trough. The last segment is redrawn: until the next reversal forms, the outermost peak or trough may move with the price.

Parameters

ParameterDescriptionDefault
DepthThe number of bars the high and low are searched among. At least 1.12
DeviationThe tolerance in price steps for removing weaker candidates. At least 1.5
BackstepHow many previous bars are checked when weaker candidates are removed. At least 1.3

Plots

ParameterDescriptionDefault
ZigZagThe zigzag line.Orange, solid, width 1

Style

The line has the Plot (show the line), Label (show the last value on the right scale), Color, Width (1–5) and Style (Solid, Dashes, Dots) fields.

How to add an indicator to the chart is described in Adding an indicator; parameters are changed in the indicator manager.

Last updated on