Harmonic Patterns Based Trend Follower
Jan 5, 2023

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:
- Zigzag Generation: It derives a zigzag based on the user-defined length to identify significant pivots.
- Pattern Scanning: It scans the last five confirmed pivots for recognized harmonic structures (e.g., Gartley, Butterfly, Bat).
- 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).
- 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.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

