Skip to content
All library documents

Finding ZigZag Support and Resistance from Repeated Swings

Article ProRealCode

Summary

The indicator identifies candidate support and resistance levels by finding repeated ZigZag troughs or peaks near the same price. A swing is defined using a configurable percentage move; the described default is 3%. Within a recent lookback window, the method checks whether at least two swings of the same type fall within a configurable percentage threshold, described as 1%, and draws a horizontal level when they do. Support and resistance plotting can be enabled separately.

The document provides code and settings, but no performance tests or evidence that the plotted levels predict future price behavior. Results depend on the instrument, timeframe, swing percentage, threshold, and lookback; the text notes that swing settings may need adjustment for the timeframe. ZigZag turning points can also change as new prices arrive, so the displayed zones should be treated as descriptive technical levels rather than validated trading signals. The code’s lookback setting differs between its introductory description and the embedded example, so users should check their intended configuration.

Key ideas

  • The indicator uses ZigZag peaks and troughs as candidate resistance and support points.
  • A level is drawn when enough same-type swings occur within a chosen percentage distance.
  • The lookback window limits which historical swings are considered.
  • Swing size and proximity thresholds may need adjustment for the instrument and timeframe.
  • The document provides no backtest or evidence that the resulting levels are profitable signals.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.