Wave Structure PRO v2 [Viprasol]Wave Structure PRO v2 is an automated Elliott Wave structure engine. It builds a ZigZag from confirmed pivots, searches for a valid 1-2-3-4-5 impulse and the following A-B-C correction, validates every candidate against Elliott's three hard rules, and scores how closely each wave matches its ideal Fibonacci proportion. On top of the count it draws the Elliott base channel, Wave 3 / Wave 5 Fibonacci targets, the next-wave retrace zone, and the exact price level where the count becomes invalid.
This is a structure assistant, not a prediction oracle. Elliott counting is inherently ambiguous, and this engine recounts as new pivots confirm. Everything it shows is derived from confirmed swing points, and it tells you honestly when no valid count exists.
HOW IT WORKS
ZigZag Pivot Engine:
Swing highs and lows are detected with a symmetric pivot window (default 8 bars left and right). A pivot only enters the structure after it is confirmed, and consecutive same-direction extremes are merged so the ZigZag always alternates high-low-high-low. The engine keeps the most recent 32 pivots as its working structure.
Sliding-Window Count Search:
The engine scans across the entire pivot structure for the most recent valid count — it does not require the pattern to end exactly at the newest pivot. A completed impulse whose correction is still developing stays on the chart and is marked "prior" in the panel, so a single awkward swing at the right edge does not wipe the analysis. At each candidate position a full 9-pivot impulse + A-B-C structure is preferred over a 6-pivot impulse alone.
Hard-Rule Validation:
Every candidate impulse must pass Elliott's three non-negotiable rules before it is accepted:
1. Wave 2 never retraces more than 100% of Wave 1
2. Wave 3 is never the shortest among Waves 1, 3, and 5
3. Wave 4 never enters the price territory of Wave 1
The A-B-C correction is additionally validated for direction and structure (B stays below the impulse extreme, C extends beyond A).
Fibonacci Quality Score:
Each wave is measured against its textbook ideal — Wave 2 near 0.5-0.618 of Wave 1, Wave 3 extending 1.618+ of Wave 1, Wave 4 near 0.382 of Wave 3, Wave 5 near equality with Wave 1. The four fits combine into a 0-100 "textbook fit" score. Extended fifth waves are scored against the alternative ideal of 0.618 x (Wave 1 + Wave 3), so a legitimately extended fifth is recognized instead of being punished, and the panel flags it as "extended 5th".
Invalidation Level:
For every accepted count the engine draws the price at which the structure stops being valid — a correction that retraces 100% of the impulse start invalidates the count. The exact level is shown on the chart, in the panel, and in the data window, giving you an objective line in the sand instead of a subjective opinion.
Alternation Check:
Waves 2 and 4 are compared as retracements of Wave 1 — when their depths differ meaningfully the panel confirms the alternation guideline is present, and shows an explicit "absent" flag when it is not.
KEY FEATURES
- Automatic 1-5 impulse and A-B-C correction detection with wave labels on the chart
- Sliding-window search — finds the most recent valid count anywhere in the structure, marked "prior" when its final pivot is not the newest swing
- Elliott's 3 hard rules enforced on every count — invalid structures are never labeled
- 0-100 Fibonacci quality score with per-wave ratio annotations at each pivot
- Extended fifth wave recognition with alternative 0.618 x (W1+W3) scoring path
- On-chart invalidation level with price label
- Elliott base channel (2-4 trendline with parallel through Wave 3)
- Wave 3 and Wave 5 Fibonacci extension targets with configurable multiples
- Next-wave retrace target zone (0.382-0.618 of the full impulse)
- Analysis panel: count state, quality, all four wave ratios, alternation, rule status, invalidation price
- Data-window outputs (quality, direction, stage, invalidation) usable by strategies and screeners via input.source
- Transition-based alerts that fire on state changes, not on every pivot refresh
HOW TO USE
Setup:
1. Add to any chart — works on all markets and timeframes
2. Use a standard candlestick chart (not Heikin Ashi)
3. Tune "Swing Sensitivity" to the wave degree you trade: higher values = larger-degree waves, lower values = smaller subdivisions
4. Defaults (sensitivity 8) suit 1H-4H charts on liquid instruments
Reading the Chart:
- Numbered labels 1-5 mark the impulse pivots; A-B-C labels mark the correction (orange)
- Small ratio numbers at pivots 2, 3, 4, 5 show each wave's Fibonacci proportion
- Dotted / dashed blue lines = Wave 3 and Wave 5 extension targets
- Cyan channel = Elliott base channel projected forward
- Purple box = expected retrace zone for the next corrective wave
- Red line = invalidation level; if price crosses it, the count is wrong
- Panel header: up/down arrow shows count direction; "prior" means the count completed before the newest swing
Reading the Panel:
- Quality 70+ = clean textbook structure; below 50 = forced fit, treat with caution
- "NO COUNT" genuinely means no valid structure exists right now — the engine never shows leftover metrics from a dead count
- The Invalidation row gives the exact price that voids the current count
SETTINGS
ZigZag: Swing sensitivity (pivot bars left/right), ZigZag visibility and color.
Waves: Wave label toggles for 1-5 and A-B-C, bullish/bearish/corrective colors, label size.
Fibonacci & Quality: Ratio annotations toggle, target visibility, Wave 3 and Wave 5 extension multiples, target color.
Channel & Target Zone: Base channel toggle and color, retrace zone toggle and color.
Invalidation: Level visibility and color.
Analysis Panel: Show/hide, position.
Alerts: Quality threshold for the high-quality alert, dynamic alert() messages toggle.
ALERTS
1. Count found — a new valid wave count appeared (fires once per count, not on every pivot extension)
2. Count invalidated — the active count stopped being valid
3. 1-5 + A-B-C complete — the correction finished, full cycle in place
4. High-quality count — a new count scored above your quality threshold
With "Dynamic alert() Messages" enabled, alert() notifications include the symbol, timeframe, direction, quality score, and invalidation price. Create the alert with condition "Any alert() function call".
LIMITATIONS & DISCLAIMER
- Elliott Wave counting is subjective by nature; this engine applies one rigorous, rule-based interpretation and recounts as new pivots confirm
- Pivots confirm with a delay equal to the swing sensitivity — labels appear after the swing completes, never in real time at the extreme
- The count can change when a developing swing extends; the transition alerts are designed around this, firing on genuine state changes only
- Wave degree is determined by your sensitivity setting; the engine does not track multiple degrees simultaneously
- Quality scoring measures Fibonacci proportion fit, not probability of continuation
- This indicator is for educational and analytical purposes only — it is not financial advice. Always use proper risk management.
ORIGINALITY
All code is original Viprasol work. Elliott Wave theory itself is public knowledge (R.N. Elliott); no third-party script was reused. v2 supersedes Wave Structure PRO with a stale-state fix, sliding-window count search, invalidation levels, extended-fifth scoring, data-window outputs, and transition-based alerts.
Chỉ báo






















