All indicators

Multi ZigZag Harmonic Patterns

Jul 25, 2021

Static chart image
SignalsFibonacciPatternsPivot Based (Retrospective)

The Multi ZigZag Harmonic Patterns indicator is an advanced technical analysis tool that identifies harmonic chart patterns by analyzing multiple ZigZag depths simultaneously. It provides traders with automated pattern recognition across different market swings, allowing for more comprehensive detection of Gartley, Butterfly, Bat, and other specialized harmonic structures.

Usage

The script displays various harmonic patterns directly on the chart, using labels to indicate the pattern type and colored shapes to define the structure. Traders can use these patterns to identify potential reversal zones where price action might change direction.

Key usage points:

  • Pattern Confirmation: The "Wait for Confirmation" setting determines if a pattern is drawn immediately upon reaching the D point or after a price pivot is established.
  • Multiple Depths: By utilizing four different ZigZag lengths, the indicator can spot patterns in micro-swings and major market trends at the same time.
  • Error Tolerance: Adjust the "Error Percent" to control how strictly the price action must adhere to the ideal Fibonacci ratios.

Details

Harmonic patterns rely on specific Fibonacci retracement and extension levels between points X, A, B, C, and D. This script monitors these relationships across multiple lookback periods (ZigZag lengths).

The following patterns and their rules are supported:

  • Gartley: XAB = 0.618; ABC = 0.382–0.886; BCD = 1.272–1.618 OR XAD = 0.786.
  • Crab: XAB = 0.382–0.618; ABC = 0.382–0.886; BCD = 2.24–3.618 OR XAD = 1.618.
  • Deep Crab: XAB = 0.886; ABC = 0.382–0.886; BCD = 2.0–3.618 OR XAD = 1.618.
  • Bat: XAB = 0.382–0.50; ABC = 0.382–0.886; BCD = 1.618–2.618 OR XAD = 0.886.
  • Butterfly: XAB = 0.786; ABC = 0.382–0.886; BCD = 1.618–2.618 OR XAD = 1.272–2.618.
  • Shark: XAB = 0.786; ABC = 1.13–1.618; BCD = 1.618–2.24 OR XAD = 0.886–1.13.
  • Cypher: XAB = 0.382–0.618; ABC = 1.13–1.414; BCD = 1.272–2.0 OR XAD = 0.786.
  • Three Drives: OXA = 0.618; XAB = 1.27–1.618; ABC = 0.618; BCD = 1.27–1.618.
  • 5-0: XAB = 1.13–1.618; ABC = 1.618–2.24; BCD = 0.5.

Settings

  • Max Pivot Size: Sets the maximum number of pivots stored for pattern analysis.
  • Show ZigZag (1-4): Toggles the visibility of the underlying ZigZag lines.
  • ZigZag Length: Defines the pivot lookback for each depth; smaller values find minor patterns, larger values find major ones.
  • Pattern Toggles: Individual checkboxes to enable/disable specific patterns like Gartley, Crab, etc.
  • Error Percent: Sets the percentage of deviation allowed from the perfect Fibonacci ratios.
  • Wait for Confirmation: If enabled, the pattern only appears after the final pivot is confirmed by price movement.
  • Bullish/Bearish Color: Customizes the visual output for pattern labels and shapes based on market direction.

FAQ

How do I interpret the patterns?

Patterns appearing at the bottom of a swing with a bullish color suggest a potential upward reversal, while patterns at the top with a bearish color suggest a potential downward reversal.

What is the purpose of having four ZigZags?

Markets are fractal; having multiple lengths allows the tool to identify patterns within patterns, providing a multi-timeframe perspective on a single chart.

How can I access Multi ZigZag Harmonic Patterns?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.