All indicators

Harmonic Patterns Based Trend Follower

Jan 5, 2023

Static chart image
SignalsPatternsPivot Based (Retrospective)

The Harmonic Patterns Based Trend Follower indicator identifies harmonic structures and utilizes their key reversal zones to establish a systematic trend-following framework. By scanning historical price pivots for patterns, the tool defines bullish and bearish boundaries that shift dynamically as new market structures emerge.

Usage

The tool operates by detecting completed harmonic patterns and using their dimensions to project entry and exit zones. When the price breaks above the established bullish zone, the trend is identified as bullish (colored green), and when it falls below the bearish zone, the trend shifts to bearish (colored red).

Example scenarios:

  • Trend Reversals: If a bullish harmonic pattern completes, the indicator calculates a bullish breakout level based on the pattern's range. A close above this level confirms a trend shift.
  • Support/Resistance: The zones act as dynamic trailing stop or breakout levels. If the price fails to breach either zone, the current trend status remains unchanged.
  • Filtering: Users can adjust the "Error %" to filter for higher-quality patterns or the "Zigzag" length to focus on different market periodicities.

Details

The script executes a multi-step process to define the trend:

  1. Zigzag Generation: It derives a zigzag based on the user-defined length to identify significant pivots.
  2. Pattern Scanning: It scans the last five confirmed pivots for recognized harmonic structures (e.g., Gartley, Butterfly, Bat).
  3. Zone Calculation: Once a pattern is confirmed, the script calculates a "Base" value (derived from the entire pattern range, the correction, or the CD leg).
  4. Trend Determination: Bullish and bearish zones are established using percentages of this base value. Because patterns are confirmed only after the pivot is set, there is an inherent delay, ensuring the trend signals are based on stable price structures rather than repainting pivots.

Settings

Supertrend

  • Base: Selects the price range used for calculation (minmax, correction, or CD leg).
  • Entry %: Determines the distance from the D pivot to the entry zone as a percentage of the base.
  • Stop %: Determines the distance from the D pivot to the stop zone as a percentage of the base.
  • Use Close Prices: When enabled, the indicator uses closing prices instead of highs/lows for breakout detection.

Harmonic Patterns

  • Error %: Sets the allowed percentage deviation for a price structure to be recognized as a harmonic pattern.
  • Zigzag: Adjusts the sensitivity of the underlying zigzag used to find pivots.
  • Log Scale: Scans for patterns using log scale calculation rather than regular price scale.
  • Display Harmonic Patterns: Toggles the visibility of the detected blue harmonic patterns on the chart.

FAQ

How do I use the zones for trading?

The green zone represents the threshold for bullish momentum, while the red zone represents the threshold for bearish momentum. A trend change occurs when price crosses these boundaries.

Why do patterns appear with a delay?

Patterns are identified based on confirmed zigzag pivots. A pivot is only confirmed after price has moved a certain distance away from it, ensuring the pattern is fixed and will not repaint.

How can I access Harmonic Patterns Based Trend Follower?

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.