Harmonic patterns

Technical Logic and Methodology
The script utilizes a pivot-based ZigZag algorithm with a default lookback of 18 pivots to identify structural swing highs and lows. Once pivots are established, the system calculates the internal Fibonacci retracement and extension ratios between five key points (X, A, B, C, and D).
Ratio Validation: The script compares real-time price action against ideal harmonic ratios (e.g., 0.618 for Gartley’s B-point) within a user-defined error margin.
Similarity Rating: A percentage-based score is calculated by measuring the cumulative deviation of all legs from their mathematical ideals. Only patterns exceeding the 79% Similarity Threshold are displayed to ensure signal quality.
Dynamic Targets: Take Profit (TP) zones are calculated based on the vertical distance of the XA leg, projected from the D-point at 0.618, 1.0, and 1.618 levels.
How to Use
Filter Patterns: Use the "General Settings" to adjust the "Pattern Size" (bars) and the "Similarity Rating" to filter out low-quality setups.
Execution: Once a pattern is labeled (e.g., "🦋 GARTLEY"), the script draws dynamic TP boxes. Traders typically look for price rejection at the D-point before targeting TP1 or TP2.
Alerts: The script includes a universal alert condition that triggers as soon as a valid, high-rating pattern completes at the D-point.
Script sob convite
Somente usuários aprovados pelo autor podem acessar este script. Você precisará solicitar e obter permissão para usá-lo. Normalmente, essa permissão é concedida após o pagamento. Para obter mais detalhes, siga as instruções do autor abaixo ou entre em contato diretamente com abo0o.
A TradingView NÃO recomenda pagar ou usar um script, a menos que você confie totalmente em seu autor e entenda como ele funciona. Você também pode encontrar alternativas gratuitas e de código aberto em nossos scripts da comunidade.
Instruções do autor
Aviso legal
Script sob convite
Somente usuários aprovados pelo autor podem acessar este script. Você precisará solicitar e obter permissão para usá-lo. Normalmente, essa permissão é concedida após o pagamento. Para obter mais detalhes, siga as instruções do autor abaixo ou entre em contato diretamente com abo0o.
A TradingView NÃO recomenda pagar ou usar um script, a menos que você confie totalmente em seu autor e entenda como ele funciona. Você também pode encontrar alternativas gratuitas e de código aberto em nossos scripts da comunidade.