All indicators

Auto Harmonic Patterns - Open Source

Jul 21, 2021

Static chart image
FibonacciPatternsPivot Based (Retrospective)

The Auto Harmonic Patterns - Open Source tool automatically identifies and plots various harmonic price structures on the chart to assist in identifying potential reversal zones. It utilizes a zigzag-based logic to detect precise Fibonacci relationships between price swings, covering a wide range of classic and modern patterns.

Usage

The indicator can be used to identify high-probability reversal points based on geometric price patterns. Users can toggle specific patterns on or off depending on their trading style. Examples of supported structures include the Gartley, Bat, Butterfly, and Crab patterns.

The tool provides visual cues such as:

  • Pattern Labels: Identifying the specific harmonic formation (e.g., "Gartley").
  • ZigZag Lines: Visualizing the underlying price swings.
  • Pivots and Ratios: Optional labels showing the Fibonacci retracement and extension levels between legs (X, A, B, C, D).

Details

The script executes by identifying pivot highs and lows over a user-defined length. It then calculates the price and time ratios between these points to verify if they meet the specific mathematical criteria for harmonic patterns.

The patterns coded within this open-source version include:

  • ABCD Variants: Classic, AB=CD, and Extension.
  • XABCD Patterns: Gartley (0.618 XA retracement), Bat (0.886 D-point), Butterfly (1.272 extension), Crab, and Deep Crab.
  • Specialty Patterns: Shark, Cypher, Three Drives, and 5-0 patterns.

Settings

  • Length: Determines the period for pivot detection. Higher values find larger, more significant patterns.
  • Error Percent: Sets the tolerance for Fibonacci ratio accuracy (default is 10%).
  • Show Pivots/Ratios/ZigZag: Toggle switches to display the internal mechanics and measurements of the patterns.
  • Colors: Customizable colors for bullish, bearish, and "trap" scenarios.
  • Pattern Toggles: Individual checkboxes to enable or disable specific patterns like Gartley, Bat, Cypher, etc.

FAQ

How do I access Auto Harmonic Patterns - Open Source?

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

What does the Error Percent setting do?

It defines how much a price ratio can deviate from the ideal Fibonacci number while still being recognized as a valid pattern.

Can I use this for automated strategy building?

Yes, as an open-source script, the logic is available for developers to reference and build upon for alerts or automated trading systems.

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.