OPEN-SOURCE SCRIPT
Telah dikemas kini

Wave Sniper

958
# Wave Sniper — Elliott Wave Flat & Confluence Detector
**by SRUS**

Wave Sniper is an advanced Elliott Wave overlay that automatically detects **flat corrections**, **3-wave pullbacks**, and **multi-timeframe wave structure** — then scores each setup for quality and confluence before marking it on your chart.

Built for traders who want clean wave-based entries without manually counting every pivot across timeframes.

---

## What It Detects

### Flat Corrections (A–B–C)
- **Regular Flat** — B retraces ~90–100% of A, C completes near A
- **Expanded Flat** — B exceeds A (up to 138.2%), C extends 123.6–161.8% of A
- **Running Flat** — B exceeds A, C fails to reach A (truncated C)

Each flat is validated with Fibonacci ratios, optional B-wave close validation, RSI momentum divergence, and volume confirmation at the C pivot.

### 3-Wave Pullbacks
- **Continuation** — three-wave pullback in the direction of the prevailing trend
- **Reversal** — three-wave structure signaling a potential turn

### 5-Wave Retest
After a flat completes, Wave Sniper tracks whether price forms a valid 5-wave extension and flags **retest opportunities** at the prior correction zone.

### Multi-Timeframe Wave Engine (15m · 1H · 4H · Daily)
Independent pivot engines run on four higher timeframes, each maintaining its own wave count state:
`WAVE_1` through `WAVE_5`, `WAVE_A/B/C`, impulse complete, correction complete.

---

## Signal System

### Triangle Markers
Confirmed setups print a **small triangle** at the C pivot:
- ▲ Green/Purple = Long bias
- ▼ Red = Short bias

Triangle color and line weight reflect the **confluence tier** — not just pattern type.

### Confluence Tiers (HTF Bonus)
| Tier | HTF Bonus | Visual |
|------|-----------|--------|
| CASCADE | 100+ | Boldest lines + chart flash |
| TRIPLE | 70–99 | Strong color, width 3 |
| WAVE | 40–69 | Medium color, width 2 |
| Single | Below 40 | Gray tint, width 1 |

**Base pattern score (0–100)** rates Fib accuracy, momentum, volume, and B-wave validation.
**HTF bonus (0–130)** adds points when chart and higher timeframes align on wave direction, impulse structure, RSI divergence, and volume behavior.

Full scoring breakdown is shown in the **info panel** (top right).

---

## Key Features

**Wave 4 Watch System**
- Detects when price enters the 23.6–38.2% Fib retrace zone of HTF Wave 3
- Confirms with RSI behavior, volume contraction, and a completing 3-wave structure
- Draws W4 MIN / W4 MAX levels and `W4 WATCH` / `W4 ✅ LOAD W5` labels

**HTF Fib Zones**
- Auto-draws Wave 4 expected retrace boxes per active timeframe
- Projects W5 targets: MIN, STANDARD, 161.8%, 261.8%

**⚡ Prime Zone**
When an HTF Wave 4 Fib zone overlaps a confirmed flat correction zone on your chart timeframe, a bright **PRIME ZONE** box highlights the overlap — highest-probability confluence area.

**Auto-Invalidation**
Patterns that break structure fade to gray and are removed from active tracking.

**Adaptive Pivots**
Pivot strength auto-adjusts to ATR and timeframe so detection stays consistent across instruments and chart periods.

**Focus Mode**
Toggle to show flats only and reduce chart clutter.

**Lookback Filter**
Auto / 1 Day / 1 Week / 1 Month / All — control how far back patterns are drawn.

---

## Info Panel

Live readout includes:
- Daily · 4H · 1H · 15m wave states
- HTF Bias (Long/Short)
- Prime Zone status
- Current chart wave state

---

## Alerts

Built-in alert conditions:
- ⚡ Wave 4 Approaching
- ✅ Wave 4 Confirmed — W5 Loading
- 🔥 Cascade Signal — All TFs Aligned
- ⚡ Prime Zone Active
- 🔁 Wave Count Invalidated (per TF)
- 🎯 Wave 5 Target Hit (MIN / 161.8%)
- Flat detected (Regular / Expanded / Running)
- 3-Wave Continuation / Reversal
- 5-Wave retest confirmed
- B-wave confirmed — watching for C

---

## Recommended Settings

| Use Case | Suggestion |
|----------|------------|
| Scalping (1m–5m) | Enable 15m + 1H layers, Min Score 65, Min HTF Bonus 40 |
| Swing (15m–1H) | All HTF layers on, Min Score 60, Min HTF Bonus 30 |
| Position (4H–D) | Daily + 4H layers, Wave Degree = Intermediate |
| Clean chart | Focus Mode ON, Max Visible = 3 |

---

## How to Read a Setup

1. **Triangle appears** at C pivot → flat or pullback confirmed
2. Check **info panel** for HTF alignment and tier
3. Watch for **W4 zone** or **Prime Zone** for entry refinement
4. Use **W5 projection lines** for targets
5. Set alerts for CASCADE or Prime Zone for hands-free monitoring

---

## Disclaimer

Wave Sniper is a **technical analysis tool**, not financial advice. Elliott Wave counting is interpretive — always confirm with your own analysis, risk management, and market context. Past pattern performance does not guarantee
Nota Keluaran
# Wave Sniper — Elliott Wave Flat & Confluence Detector
**by SRUS**

Wave Sniper automatically detects **flat corrections**, **3-wave pullbacks**, and **multi-timeframe wave structure** — then maps **where price needs to go next** with per-timeframe destination boxes and live distance percentages.

---

## Per-Timeframe Destination Boxes

Wave Sniper draws **separate destination zones for every active timeframe** (your chart TF + 15m / 1H / 4H / Daily). Each gets its own column on the right margin.

### →W4 Destination (Wave 3 active)
When a TF is in **Wave 3**, a **cyan box** marks the expected **Wave 4 pullback zone** (23.6–38.2% retrace of Wave 3).

| Label | Meaning |
|-------|---------|
| `→W4 1H +0.8%` | 1H W4 zone is 0.8% above price |
| `→W4 4H IN` | Price is inside the 4H W4 destination |
| `→W4 5 -1.5%` | Chart TF W4 zone is 1.5% below |

### →W5 Destination (Wave 4 confirmed)
When a TF has **confirmed Wave 4**, a **yellow box** spans the **MIN–STD** zone where Wave 5 should complete, plus extension ticks at 161% and 261%.

| Label | Meaning |
|-------|---------|
| `→W5 4H +3.2%` | 4H W5 destination zone is 3.2% above |
| `→W5 15m IN` | Price inside the 15m W5 finish zone |
| `MIN +1.1%` | Minimum W5 target distance |

**+** = above price · **−** = below · **IN** = inside the zone

Toggle: **W4 Destination Zones (W3→W4)** and **W5 Destination Boxes (W4→W5)** in Neon Markers settings.

---

## What It Detects

### Flat Corrections (A–B–C)
Regular · Expanded · Running flats with Fib validation, RSI divergence, and volume confirmation.

### 3-Wave Pullbacks
Continuation (blue) and Reversal (red) structures with triangle signals at C.

### Live Impulse Count (1–2–3–4–5)
Progressive wave lines and numbered labels on the chart TF. Auto-resets on invalidation.

### Completed 5-Wave History
Up to 5 completed impulses frozen on chart for backtesting.

### Multi-Timeframe Engine
**HTF:** 15m · 1H · 4H · Daily
**Micro:** 1m · 3m · 5m

---

## Other Neon Markers

| Marker | When |
|--------|------|
| **Pattern Zone** | Compact tick at flat/pullback C pivot |
| **Prime Zone** | HTF W4 overlaps confirmed flat/pullback |
| **Fib C Targets** | 100% · 123.6% · 161.8% C projections |

All markers support **live distance %**. Colors fully customizable.

---

## Confluence Scoring
- **Base score (0–100)** — pattern quality
- **HTF bonus (0–170)** — multi-TF alignment

---

## Alerts
Flat · Pullback · Retest · Impulse complete · W4 approaching/confirmed · W4 live · Prime Zone · Cascade · Micro W5 · W5 target hit · Wave invalidated · Structure broken

---

## How to Read a Setup

1. **Triangle at C** → flat or pullback confirmed
2. **→W4 boxes** → where each TF expects the W4 pullback to finish
3. **→W5 boxes** → where each TF expects Wave 5 to complete after W4 confirms
4. Glance at **+/- %** labels — instant read on distance to every zone
5. **Prime Zone IN** → highest confluence overlap
6. Set alerts for W4 confirmed / Cascade / Prime Zone

---

## Disclaimer

Wave Sniper is a technical analysis tool, not financial advice. Elliott Wave counting is interpretive — always confirm with your own analysis and risk management.

**SRUS Wave Sniper** — See the structure. Snipe the setup.
Nota Keluaran
---

## What’s New in This Version

### Trend Alignment (EMA filter)
New **Trend Alignment** settings gate wave-based targets by trend:
- **Require Wave Direction Align with EMA Trend** — on by default
- **EMA Trend Length** — default 50
- **Trend Filter Mode** — Direction or Direction+Above/Below

Bullish wave boxes (W2→W3, →W4, →W5, ► LEAD) only appear when price is above the EMA. Bearish setups require price below. Counter-trend projections are hidden automatically.

### W2→W3 Projection Boxes
When your chart timeframe is in **Wave 2**, neon margin ticks project:
- **W3 162** — 1.618 × Wave 1 length from the W2 pivot
- **W3 200** — 2.0 × Wave 1 extension target

Toggle: **W2→W3 Projection Boxes** in Neon Markers.

### Leading Target (► LEAD)
Scores every active TF’s W4 destination and W5 completion zones, then highlights the single best candidate using:
- Multi-TF zone overlap (more TFs = higher score)
- TF weight (Daily > 4H > 1H > 15m)
- Wave phase priority (W4 DEST vs W5 STD/MIN/EXT)
- Trend Alignment filter

Toggle: **Enable Leading Target Box** in Leading Probability (on by default).

### Leading Probability (optional)
| Layer | Default | Purpose |
|-------|---------|---------|
| **Leading Target Box** | ON | Single best destination (► LEAD) |
| Price Magnet Heat Map | OFF | Overlapping zones across TFs |
| Fibonacci Time Projection | OFF | Time windows for W4/W5 completion |
| Next Stop Label | OFF | Nearest scored zone label |
| W3 Exhaustion | OFF | RSI div + vol/MACD exhaustion tint |

### Visual cleanup
- Compact margin ticks instead of tall zone towers on price
- Less chart clutter — optional layers off by default
- Live **+/- %** and **IN** on all zone labels retained

---
Nota Keluaran
Wave Sniper — TradingView update copy you can paste into the script description / release notes.

Short Description (public listing)
Multi-timeframe Elliott Wave engine for flats, impulses, and leading setups. Margin-only neon markers for W2/W4/W5 and C-wave targets — nothing glued to the live candle. Bottom-right Next Stop panel shows what wave is expected next, live phase (START → IN ZONE → LATE → EXTENDED), targets, and confidence. Built for 5m–1H; auto lite mode on 4H+.

Release Notes — What's New
Next Stop Panel (major upgrade)
On by default — compact bottom-right panel (no chart clutter)
Live phase row — know if the move is just starting, in progress, in zone, late, or already extended past target
Bars since pivot — see how long the current wave leg has been running
Bright white text, direction-colored border only
Covers W1→W2 through W5→ABC plus corrective A/B/C states
W2 Pullback Zone (new)
Pink W2 PB margin box during WAVE_1 (50%–78.6% retracement of W1)
Same toggle as W3 projection: W2 Pullback & W3 Projection Zones
Per-TF markers on enabled HTF layers
C Wave Projection (redesigned)
Margin-only — C100 / C124 / C162 / CRUN ticks on the right edge
→C REG and →C EXT zone bands after B confirms
Works on WAVE_B and zigzag flat B — see C targets before C forms
No forward boxes, dashed lines, or labels on the active candle
Removed / cleaned up
Live wave line removed (was glued to price and covered candles)
27-row Info Table removed (lighter + faster; Next Stop panel replaces it)
Forward C projection boxes removed
Performance & stability
HTF lite mode on 4H+ — skips heavy request.security() calls to prevent memory/runtime errors
Smart TF filtering — only fetches layers above/below chart TF (no redundant security calls)
Reduced historical calc window (1200 bars)
Toggle gating fixed (Magnet, W3 Exhaust, C Proj, W2 markers)
Still included from prior builds
EMA Trend Alignment filter for wave direction
► LEAD leading target box (highest-probability multi-TF destination)
W4 / W5 margin destination markers
Prime Zone overlap detection
3-wave pullback + flat pattern scoring
Full alert suite (W4 approaching, C loading, lead target, magnets, etc.)
Recommended Settings
Use case Suggested toggles
Clean chart
Next Stop ON, W2/W4/W5 markers ON, disable Magnet + Time Proj
Scalping 5m
15m + 1H HTF ON, micro layers optional
4H / Daily
Chart-only lite mode auto — use margin markers + Next Stop
Alerts available
C Wave Loading (B confirmed)
W4 Approaching / Confirmed
W5 Target Hit (MIN / 161%)
Prime Zone Active
Magnet Zone Convergence (3+ TFs)
Lead Target shift
Flat / Pullback pattern detected
Wave count invalidated (per HTF)
Nota Keluaran
What's New
Next Stop panel (major upgrade)

Bottom-right card is on by default with bright white text for readability
Header shows EXPECTING: W2 pullback (and similar) instead of raw WAVE_1 state codes
Phase row — live progress: START / IN ZONE / EARLY / MID / LATE / EXTENDED / DEEP
Time row — clock-time estimates (e.g. Est: 11:30 AM–11:45 AM) with bar counts in parentheses; pivot start shown as Since 6:00 AM (270b)
Target, confidence, and direction-colored border retained
C wave projection (margin-only)

C targets (REG / 100% / 123.6% / 161.8% / RUN) draw on the right margin before C confirms — no forward boxes/lines on live candles
Toggle: Enable C Wave Projection (margin)
W2 pullback zone

Pink W2 PB margin zone (50%–78.6% of W1) during WAVE_1
Under W2 Pullback & W3 Projection Zones
Flat quality tier system

4-tier scoring (HTF confluence + 5 reversal factors): glow, triangles, zone fill, factor dots
PRIME and STRONG composite reversal alerts (4–5 factors)
Stricter impulse/ABC rules via upgraded classifyWaveState() (W2 no-cross, degree-scaled W3 min, W4 overlap tolerance, W5 fib validation)
Performance

calc_bars_count reduced to 1200
HTF layers auto-filter by chart TF (e.g. 15m only below 15m chart)
HTF lite mode on 4H+ to avoid memory errors
Drawing leak fixes (W3 exhaust box, pattern zones, factor dots) — fewer orphaned objects
Chart cleanliness

Live dashed line to price is off by default — toggle Show Live Forming Wave if you want it
Removed 27-row top-right Info Table (reduced clutter + runtime)
Impulse labels: tiered W3/W4/W5 styling
Alerts added / improved

PRIME / STRONG flat reversal (factor-based)
HTF-aware C WAVE LOADING when B confirms
Existing alerts retained: impulse complete, W4 live, cascade, W5 targets, magnet, lead target, etc.
Stability fixes

Runtime crash on pattern removal (factor dot cleanup)
Pine compile fixes (multi-line or/and, line.style type)
CW10003 HTF fetch consistency (security calls every bar)
Removed / Changed Defaults
Item Change
Info Table
Removed
Live forming wave line
Default OFF (new toggle)
C projection on candles
Removed — margin only
Next Stop panel
Default ON
Fib C Target Boxes
Default OFF (use C margin projection instead)
Nota Keluaran
Wave Sniper by SRUS detects Regular, Expanded, and Running Elliott flats with multi-TF confluence (15m / 1H / 4H / Daily + micro layers). Confirmed flats stay on chart with scoring, tiered signals, and Flat Stack / Fractal Cascade bonuses.

New in this build: After B confirms, C targets latch and stay active until C completes — dashed C100 / C124 / C162 lines from the B pivot, →C LOADING status, and margin →C REG/EXT zones. Up to 12 visible flat patterns; invalidated flats fade (red X) instead of disappearing.

Also: predictive A→B→C, HTF W4/W5/Prime margin markers, 3-wave pullbacks, 5-wave retests, leading target overlap, and bot-ready JSON alerts (flat_signal, c_wave_loading, truncated_w5).

Key settings: Enable Flat C Projection After B · Draw C Target Lines on Chart · Max Visible Patterns 12+ · Lookback 1 Week or All. Fib Time Projection is W3→W4 timing only — not flat C targets.

Release notes / changelog (What's new)

v2.1 — B→C Latch & Flat History
B→C FIX
• C targets now appear after B pivot confirms (latched B→C state)
• Chart dashed lines: C100 / C124 / C162 from B pivot
• →C LOADING label on chart + margin
• C projection no longer blocked by A-wave validation
• Pre-entry signal works on any B-confirmed flat, not just WAVE_B label
FLAT HISTORY
• Default 12 visible patterns (was 5)
• All confirmed flats drawn; score/HTF only affects emphasis + alerts
• Invalidated flats fade with red X until lookback expires
CLARITY
• "Enable Flat C Projection After B" (was generic C Wave Projection)
• "Fib Time Projection (W3→W4 timing only)" — separate from flat C
FIX
• preEntryLbl compile error
• Predictive C drawing lifecycle

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.