OPEN-SOURCE SCRIPT

Elliott Wave Pattern Analyzer

642
Elliott Wave Pattern Analyzer
Overview
This indicator automatically detects Elliott Wave impulse patterns and diagonal formations on your chart. It analyzes price structure based on classic Elliott Wave rules and displays wave counts with confidence scores, Fibonacci projections, and invalidation levels.

Why I Built This
After reading Glenn Neely's book on Elliott Wave theory, I wanted to put my learning into practice by building something tangible. There's no better way to understand a concept than trying to code it!
I'll be honest – corrective wave patterns (zigzags, flats, triangles, combinations) were simply too complex for me to implement reliably. So instead, I focused on what I could manage: impulse waves and diagonal patterns. Maybe someday I'll tackle the corrections, but for now, this is my humble contribution.
The retracement visualization style was inspired by LuxAlgo's elegant approach – credit where credit is due!

How It Works
1. Wave Detection
The indicator uses pivot points to identify potential 5-wave structures:
WaveRuleWave 2Cannot retrace more than 100% of Wave 1Wave 3Cannot be the shortest among Waves 1, 3, 5Wave 4Should not overlap Wave 1 territory (impulse)Wave 5Completes the motive structure
2. Pattern Types
Impulse Waves

Classic 5-wave motive structure
Wave 3 typically extends (≥1.618 of Wave 1)
Strict mode enforces all Elliott rules

Diagonal Patterns

Ending diagonal (wedge-shaped)
Waves progressively contract
Lines 1-3 and 2-4 converge to an apex
Often signals trend exhaustion

3. Confidence Scoring
Each pattern receives a confidence score (0-100%) based on:

Fibonacci ratio adherence
Wave proportion relationships
Rule compliance
Structural clarity

Only patterns exceeding your threshold (default: 60%) are displayed.
4. Fibonacci Projections
After Wave 5 completion, the indicator projects potential retracement levels:

0.382, 0.500, 0.618, 0.786 of the entire impulse

5. Extension Channel
Connects Wave 0 origin to the retracement low, projecting:

0.618, 1.000, 1.272, 1.618 extensions
Optional extended levels: 2.000, 2.618, 4.236

6. Invalidation Levels
Shows the price level where the wave count becomes invalid – helping you know when your analysis is wrong.

Settings Explained
Impulse Wave Settings

Pivot Length: Sensitivity of wave detection (recommended: 5, 7, 14)
Strict Mode: Enforce all classic Elliott rules
Min Wave 3 Extension: Minimum ratio for Wave 3 (default: 1.618)

Diagonal Wave Settings

Allow Wave 4-1 Overlap: Required for valid diagonals
Extend Trendline: Project diagonal boundaries forward

Projection Settings

Fibonacci Levels: Customize retracement targets
Extension Bars: How far projections extend on chart

Pattern Management

Max Patterns: Limit displayed patterns to reduce clutter
Pattern Lifetime: Auto-remove old patterns after X bars


Use Cases

Trend Trading: Enter on Wave 3 or Wave 5 breakouts
Reversal Spotting: Diagonal completion often signals reversals
Target Setting: Use Fibonacci extensions for take-profit levels
Risk Management: Invalidation levels provide clear stop-loss references


Notes

This indicator uses pivot detection and may repaint – signals are confirmed after the specified pivot length
Designed for educational and analytical purposes, not as a signal generator
Elliott Wave analysis is subjective – this is my algorithmic interpretation
Works best on liquid markets with clear trend structure
Not financial advice – always do your own research


Re-publishing Notice
This indicator was previously blocked due to some house rule violations on my part. I've recently had time to review and fix those issues, and I'm now re-publishing a compliant version. Thanks for your patience!

Feedback Welcome
I'm still learning Elliott Wave theory myself, so if you spot any issues or have suggestions for improvement, please leave a comment. Let's learn together!
Happy trading! 📈

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.