All Harmonic Patterns
Jul 29, 2024

The All Harmonic Patterns indicator is a comprehensive tool designed to automatically identify, draw, and alert users to a wide variety of harmonic price structures as they form in real-time. By automating the detection of complex patterns such as Gartleys, Bats, and Butterflies, it aims to provide traders with consistent technical analysis across multiple timeframes and markets.
Usage
This tool can be used to identify potential reversal or continuation points based on historical price action and Fibonacci relationships.
- Pattern Visualization: The indicator automatically plots the legs of each pattern on the chart. Bearish patterns are typically highlighted in red, while bullish patterns are highlighted in green (customizable in settings).
- Strategy Integration: Users can utilize these patterns as a confluence for existing strategies. For example, a Bullish Gartley forming at a major support level might indicate a high-probability long entry.
- Backtesting: By applying the indicator to Bar Replay mode, traders can study how different harmonic patterns performed historically on specific assets.
- Alerts: Each pattern has an independent alert toggle, allowing traders to be notified only for the specific structures that fit their trading plan.
Details
The script identifies patterns based on a sequence of swing highs and swing lows. A swing high is defined as a peak formed by a green candle (or series of green candles) followed by a red candle, while a swing low is a trough formed by red candles followed by a green candle.
Patterns are calculated using retracement and extension ratios, which are the percentage differences between consecutive price ranges. Because "perfect" harmonic ratios are rare in live markets, the script incorporates Measurement Tolerances. This allows the logic to identify patterns that are technically valid within a specific percentage of deviation from the ideal Fibonacci levels.
The indicator currently supports the following patterns:
- Classic: ABCD, Gartley, Bat, Alternate Bat, Butterfly, Crab, Deep Crab.
- Modern/Complex: 5-0, Cypher, Shark, Three-Drive.
- Proprietary/Custom: Cassiopeia (A, B, and C variants).
Settings
Pattern Colours
- Bearish Pattern Colour: Sets the color for bearish harmonic shapes and lines.
- Bullish Pattern Colour: Sets the color for bullish harmonic shapes and lines.
- Neutral Pattern Colour: Sets the color for neutral structures.
- Dotted Line Colour: Sets the color for the internal projection lines.
Patterns
- Show [Pattern Name]: Individual toggles to enable or disable the detection and drawing of specific patterns (e.g., Show Bear 5-0, Show Bull ABCD).
Pattern Tolerances
- AB/BC/CD/AD/XC Tolerance (%): Adjusts the allowable percentage deviation for each leg of the harmonic patterns. Increasing these values will result in more patterns being detected, while decreasing them requires stricter adherence to Fibonacci ratios.
Alerts
- [Pattern] Alert: Individual toggles to enable TradingView alerts for each specific pattern type.
FAQ
How do I access All Harmonic Patterns? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Why do some patterns disappear or change? Harmonic patterns are based on swing points. As new price data arrives, a swing point may be redefined if a higher high or lower low is formed before the swing is "confirmed," which in turn updates the pattern logic.
Which markets work best with this indicator? While it works on all timeframes, it is recommended for use on 24-hour markets (like Forex or Crypto) to minimize the impact of price gaps, which can occasionally affect the swing detection logic.
Sources
Edwards, R., & Magee, J. (1948) Technical Analysis of Stock Trends.
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.