OPEN-SOURCE SCRIPT

Harmonic Pattern Finder - [XoRonX]

1 467
Overview
Harmonic Pattern Finder is an institutional-grade, fully automatic pattern detection and projection tool designed to identify and scan harmonic patterns on your charts in real time. Ported to Pine Script v6, this advanced version introduces volatility-based swing detection, multi-criteria structural filtering, real-time projections, and built-in historical statistics.

The indicator uses a dynamic ATR-based ZigZag engine to establish structural swings. It then checks these swings against precise Fibonacci ratio rules to identify both completed and emerging harmonic structures, outlining the exact Potential Reversal Zone (PRZ) for potential trade setups.

---

Supported Patterns
This indicator automatically scans for 7 classic harmonic pattern variations (supporting both Bullish and Bearish structures):
  1. Gartley
  2. Bat
  3. Butterfly
  4. Crab
  5. Deep Crab
  6. Cypher
  7. Shark


Each pattern can be individually toggled on or off in the user settings.

---

Key Features

# 1. Volatility-Adaptive ZigZag Engine
Unlike static depth-based ZigZags, this script uses an Average True Range (ATR) filter. This allows swing points to dynamically adapt to shifting market volatility across different assets, timeframes, and market conditions.

# 2. Potential Reversal Zone (PRZ) Boxes & Lines
For every detected pattern, the indicator plots a highlighted PRZ Box and a PRZ Line extending into the future.
  • PRZ Box: Clearly visualizes the range between the near and far target zones.
  • PRZ Extensions: Extends to the right, letting you monitor price reactions upon entering the zone.


# 3. Real-time Projections & Emerging Patterns
Never miss a setup. The indicator displays:
  • Confirmed Patterns: Completed structures.
  • Transient & Emerging Patterns: Patterns that are actively developing in real time.
  • One-Ahead Projections: Projects the D-leg before it completes, allowing you to prepare for potential entries in advance.


# 4. Leg Balance & Time Filters
Eliminate noisy, deformed, or rushed structures. The script incorporates:
  • Leg Balance Filter: Verifies that the time duration (number of bars) of each leg (XA, AB, BC, CD) is balanced and proportional.
  • Time Filters: Eliminates patterns that complete "too early" or "too late" relative to the structural timeframe of the pattern.
  • Purist PRZ: Filter patterns that don't have their Fibonacci ratios landing precisely in the PRZ.


# 5. Focus Details Mode
Enable the Focus Details setting to isolate a specific pattern and display detailed target Fibonacci ratios (AD2XA, CD2XC, CD2BC, etc.) and time targets ("early", "ideal", "late" boundaries) directly on the chart.

# 6. Live Statistical Dashboard (Win-Rate Table)
A clean, table-based dashboard on the top-left calculates historical pattern outcomes based on the visible chart history:
  • P. (Persistent / Completed)
  • T. (Transient / Active)
  • O. (Overshot / Failed)

It calculates and displays the historical success probability for each pattern.

---

How to Trade with This Indicator
  1. Identify the PRZ: Watch for the highlighted box and lines when a pattern is nearing completion.
  2. Wait for Price Action Confirmation: Do not blindly enter at the PRZ. Look for reversal candlestick patterns (e.g., pinbars, engulfing candles) or momentum divergence (RSI/MACD) inside the PRZ box.
  3. Stop Loss (SL): Positioned just beyond the "PRZ Stop" line (the far limit of the PRZ).
  4. Take Profit (TP): Typically targeted at key Fibonacci retracements of the AD leg (usually 38.2% and 61.8%).


---
*Disclaimer: Harmonic patterns are structural guides and are most effective when combined with other indicators (RSI, volume, key support/resistance) and proper risk management. Past performance does not guarantee future results.*

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。