Gartley Harmonic Pattern Harmonic Chart patterns
Jul 25, 2024

The Gartley Harmonic Pattern indicator automatically identifies and visualizes one of the most significant harmonic structures in technical analysis to help traders predict potential market reversals. By utilizing Fibonacci retracement levels and ZigZag pivots, this tool highlights high-probability "M" and "W" formations that signal upcoming bullish or bearish price action.
Usage
The Gartley Harmonic Pattern is used to identify reversal points at the end of trends or corrections.
- Bullish Gartley: Resembles an "M" shape. It occurs when an initial upward move (XA) is followed by a series of corrective waves (ABCD). Traders typically look for buying opportunities at point D, where price is expected to reverse upward.
- Bearish Gartley: Resembles a "W" shape. It forms when an initial downward move (XA) is followed by corrective waves (ABCD). Traders monitor point D for potential shorting opportunities or trend reversals to the downside.
The indicator allows users to toggle "Show Valid Format" to filter out noisy patterns and only display those that strictly adhere to classical Fibonacci ratios. Additionally, the "Last Pivot Confirm" feature helps traders wait for price confirmation before a pattern is fully validated.
Details
The script follows the specific structural rules defined by H.M. Gartley and further refined by Scott Carney. The construction relies on the following Fibonacci relationships between five key points (X, A, B, C, and D):
- B point: Ideally a 61.8% retracement of the XA leg.
- C point: A retracement of the AB leg, typically between 38.2% and 88.6%.
- D point: The final completion point, often representing a 78.6% retracement of the XA leg and an extension of the BC leg (1.13 to 1.618).
The implementation uses a ZigZag-based logic to detect pivots and calculate the geometric ratios required for harmonic validation.
Settings
Logical Setting
- ZigZag Pivot Period: Adjusts the sensitivity of the pivot detection; higher values detect major swings, while lower values detect minor fluctuations.
- Show Valid Format: When enabled, filters out patterns that do not strictly match the ideal Fibonacci ratios.
- Show Formation Last Pivot Confirm: If enabled, the pattern only completes once the final pivot is confirmed, reducing the likelihood of drawing failed patterns.
- Period of Formation Last Pivot: Sets the lookback period specifically for confirming the final D-point pivot.
Display Setting
- Show Bullish/Bearish Pattern: Toggles the visibility of specific pattern types.
- Color Bullish/Bearish Pattern: Customizes the visual color for the XABCD shapes.
- Width Line: Adjusts the thickness of the lines connecting the harmonic points.
- Label Size: Changes the size of the text labels (X, A, B, C, D) on the chart.
- Switching Colors Theme Mode: Provides presets for Light or Dark theme compatibility.
Alert
- Alert: Enables or disables alert triggering.
- Message Frequency: Controls how often alerts are sent (All, Once Per Bar, or Per Bar Close).
- Show Alert Time by Time Zone: Allows the timestamp in alert messages to be adjusted to a specific UTC offset.
FAQ
How do I access the Gartley Harmonic Pattern?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
What is the difference between the "Valid Format" and standard mode?
The "Valid Format" setting applies a stricter filter to the Fibonacci ratios between points. In standard mode, the script may show patterns that are visually similar to a Gartley but have more "noise" or slight deviations from the ideal mathematical ratios.
Can I use this for intraday trading?
Yes, the indicator works on all timeframes. However, harmonic patterns are often considered more reliable on higher timeframes (like 1H, 4H, or Daily) as they filter out market noise more effectively than lower timeframes.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.