PROTECTED SOURCE SCRIPT

Elliott Wave Rule Engine v3.0 Pro

236
Elliott Wave Rule Engine v3.0 Pro — User Guide
A professional-grade Elliott Wave analysis tool featuring tri-degree swing detection, rule-based pattern validation, and divergence-gated signal generation.
Overview
This indicator implements a sophisticated multi-timeframe Elliott Wave detection system that analyzes price action across three degrees simultaneously—Small, Medium, and Large. It validates wave patterns against strict Elliott Wave rules, generates consensus-based trading signals, and integrates advanced RSI divergence filtering to reduce false positives.
The engine distinguishes between Impulse waves, Diagonals, Corrective patterns (ZigZags, Flats), and Triangles while providing real-time targets, invalidation levels, and per-wave continuation signals.
Core Architecture
Tri-Degree Swing Detection
The script runs three parallel swing detection engines:
  • []Small Degree: Short-term pivots (1-100 bars left, 1 bar right) capturing micro-structure
    []Medium Degree: Intermediate swings (1-300 bars left, 1 bar right) for wave context
  • Large Degree: Major pivots (1-500 bars left, 1 bar right) for trend alignment

Each degree uses an aggressive looped pivot scanner that tests multiple left/right bar combinations to find the most significant highs and lows, then filters results by minimum percentage change thresholds.
Pattern Recognition Engine
Motive Waves (Impulse vs Diagonal)
For every valid 6-pivot sequence, the engine evaluates both Impulse and Diagonal pattern quality:
Impulse Wave Rules:
  • []Wave 2 does not retrace 100% of Wave 1
    []Wave 3 is never the shortest among Waves 1, 3, and 5
    []Wave 4 does not overlap Wave 1 price territory
    []Fibonacci retracement alignment for Waves 2 and 4
    []Wave 3 exhibits strongest momentum (sharpest slope)
    []Alternation between Waves 2 and 4 (time/depth/sharpness)
    []Proportionality constraints on time and price
    []Wave 5 divergence/weakening relative to Wave 3

Diagonal Wave Rules:
  • []Same hard rules as Impulse for Wave 2 and Wave 3 length
    []Wave 4 must overlap or approach Wave 1 territory
    []Contracting or expanding wedge boundaries confirmed
    []Deep retracements (≥50%) expected in Waves 2 and 4
    []Relaxed proportionality tolerances
    []Fibonacci alignment for corrective legs

The engine automatically selects the higher-quality pattern based on guideline pass rates.
Corrective Patterns
When motive waves fail validation, the system checks for:
  • []ZigZag: Sharp 5-3-5 structure with shallow Wave B (<61.8% of A) and Wave C ≈ A or 1.618×A
    []Flat: 3-3-5 with deep Wave B (≥90% of A), expanded or running variations
  • Triangle: 5-wave contracting or expanding boundary pattern with alternating pivots

Signal Generation System
Three Signal Tiers
  • []Early Signals: Loop-consensus based alerts requiring directional alignment across degrees but before full motive validation—optimal for aggressive entries with divergence confirmation
    []Final Signals: Full pattern-validated signals requiring completed motive structure, quality thresholds, and optional large-degree confirmation
  • Per-Wave Signals: Specific continuation/reversal alerts at Wave 2, Wave 4, Wave 5, ABC completion, and Triangle E-wave breakout points

Consensus Scoring
Each signal tier uses weighted consensus from all three degrees:
  • []Small degree consensus (buy/sell pivot detection rate)
    []Medium degree consensus (contextual alignment)
    []Large degree consensus (structural trend agreement)
    []Quality-weighted composite score combining pattern guideline passes

Signals require minimum consensus thresholds per degree plus margin superiority over opposing direction.
Advanced RSI Divergence Engine
Divergence Detection
The system identifies classic and hidden divergences using:
  • []Confirmed price pivots with configurable left/right confirmation bars
    []RSI slope non-intersection validation (no mid-line crosses)
    []Over-extension ratio analysis (zigzag leg comparison ≥2.0×)
    []Oversold/overbought zone filtering at P2 endpoints
  • Minimum RSI delta, price delta %, and ATR-multiple thresholds

Wave-Gated Divergence
Divergences can be filtered to trigger only when aligned with wave structure:
  • []Require completed motive wave (1-5 or diagonal) at Small or Medium degree
    []Allow triangle completions as alternative trigger
    []Enforce trend direction agreement across degrees
    []Attach to specific pivot degrees (Small/Medium/Large/Any)
    []Apply consensus minima and range-edge proximity filters
    []Composite scoring (0-100%) for strength ranking

Unified Signal Gating
Divergence can gate Early signals, Final signals, and Per-Wave signals independently—ensuring momentum confirmation before pattern-based entries.
Sideways/Range Detection
When price action exhibits low net progress relative to range over recent swings:
  • []Automatic sideways flag activation
    []Edge proximity detection (configurable % from range boundaries)
    []Fade-at-edges signal preference (buy near support, sell near resistance)
    []Alternative target projection using range midpoint and measured moves

Target & Invalidation System
Final Targets (Motive Waves)
Upon confirmed 5-wave completion:
  • []T1: 38.2% retracement of full motive wave
    []T2: 50% retracement
    []T3: 61.8% retracement
    []T4: Wave 4 terminus (structural support/resistance)

Early Targets (Pre-Validation)
Based on last completed swing:
  • []0.618×, 1.0×, and 1.618× projections
    []Range midpoint and measured extensions in sideways conditions

Invalidation Levels
Automatic placement beyond wave extremes with configurable tick buffer—updated dynamically as structure evolves.
Visual Feedback
  • []Small degree swings: Blue connecting lines
    []Medium degree swings: Purple connecting lines
    []Large degree swings: Orange connecting lines
    []Valid motive structure: Green background tint
    []Divergence lines: Dotted green (bullish) / red (bearish) with score annotations
    []Signal labels: Directional arrows with consensus percentage
  • Optional wave labels (1-5, A-E) at pivot points

Key Input Parameters
Swing Detection Sensitivity
Adjust left/right bar ranges and minimum swing percentages per degree to match instrument volatility and timeframe.
Rule Engine Tolerances
  • []Fibonacci tolerance: Acceptance band for ratio alignment
    []Proportionality limits: Max time/price variance between same-degree waves
    []Alternation threshold: Minimum slope ratio for Wave 2 vs 4 distinction
    []Minimum guideline passes: Quality threshold for pattern validation

Signal Thresholds
  • []Consensus minima per degree (0.0-1.0 scale)
    []Consensus margin vs opposite direction
    []Direction alignment mode (None/Majority/AllThree/pairwise combinations)
    []Large-degree validation requirement toggle

Divergence Configuration
  • []RSI length and overbought/oversold levels
    []Pivot confirmation bars and lookback limits
    []Cooldown periods between same-side divergences
    []Wave gating toggles and attachment degree
  • Composite score weightings and minimums

Operational Workflow
  1. []Configure swing detection ranges appropriate to your chart timeframe and instrument volatility
    []Set rule tolerances based on how strictly you want Elliott Wave rules enforced
    []Adjust consensus thresholds—higher for confirmation, lower for sensitivity
    []Enable divergence gating for higher-probability signals
    []Monitor Early signals for preemptive entries, Final signals for confirmed structure
    []Use Per-Wave signals for precise entry timing within known wave positions
  2. Reference plotted targets and invalidation levels for trade management

Best Practices
  • []Use higher timeframes (1H+) for reliable Large-degree structure
    []Reduce swing ranges for volatile instruments, increase for stable markets
    []Enable divergence gating during choppy conditions to filter noise
    []Require Large-degree validation for major position entries
    []Monitor sideways detection—range-edge signals often precede breakouts
    []Check wave labels and diagnostic arrays when signals seem inconsistent

This tool provides probabilistic wave analysis, not deterministic predictions. Always combine with sound risk management and broader market context.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน