Skip to content
All library documents

Configurable Harmonic Pattern Scanning with Recursive Zigzags

Article ProRealCode

Summary

The document explains a configurable scanner for five- and six-pivot harmonic structures. Rather than hard-coding named patterns, users specify acceptable ranges for ratios between legs such as XAB, ABC, and BCD. The scanner builds a recursive zigzag from price pivots, then checks structures at multiple swing scales. It can draw pivot labels, measured ratios, a projected potential reversal zone, and a summary of detected patterns. Example ratio settings are supplied for Three Drives, Gartley, Bat, Butterfly, and Crab patterns.

A single ratio value is expanded by a percentage tolerance, whereas a range with distinct endpoints is used literally. Enabled projected ratios intersect to define the reversal zone. The document warns that recent pivots can move in real time; waiting for confirmed bars avoids that movement but delays signals. It also reports only that a geometric match exists, not that the pattern predicts profitable price behavior. One example found a single default Three Drives match on the S&P 500 daily chart over the stated period, illustrating how restrictive simultaneous ratio filters can be. Performance depends in part on retained pivot depth.

Key ideas

  • Users define harmonic structures by enabling leg ratios and setting target values or ranges.
  • A recursive zigzag lets the scanner search patterns across several swing scales.
  • A single ratio target receives a tolerance, while a bounded range is applied as specified.
  • Projected ratios can be intersected to form a potential reversal zone.
  • Live pivots may change, and a geometric match alone does not establish a trading edge.

Tags

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