OPEN-SOURCE SCRIPT

Breakout Squeeze – Early Detector (BRK-SQZ)

412
syot kilat

What it does
Squeeze — price goes quiet (Bollinger Band Width compresses vs its recent average).
Fuel — volume expands vs its 20-bar average.
Level — price takes out a recent high.
Quality — the close is near the top of the candle’s range.

When those stack up you get a signal. You can choose Strict (safer, later) or Early (faster, noisier).

What you’ll see on the chart
Blue background → in a squeeze (coiled).
Orange dots (bottom) → volume currently above threshold.
Green tiny caret (above bar) → price is testing/clearing the breakout level.
Aqua diamond labeled “PRE” (above bar) → Pre-Signal (any 3 of 4 checks are true). Early heads-up.
Lime triangle “BRK” (below bar) → Confirmed Long breakout (all 4 checks pass).

Tip: PRE can fire intrabar for early notice. The BRK triangle is your confirmation.

Inputs (the only knobs that matter)
Early (default): high or close can break the level; looser volume/close filters.
Strict: close must break the level; stronger volume/close placement.

Core
BB Length (20), BB Mult (2.0)
Squeeze Lookback (40) — moving average window for BB Width.
Squeeze Threshold (sqzFactor) (0.60) — lower = tighter squeeze requirement.
Breakout
Breakout Lookback (brkLen) (20) — new high must clear the prior N bars.
Volume
Volume SMA Length (20)
Volume Spike ≥ (Early/Strict) (1.5 / 2.0) — multiplier vs avg volume.
Candle Quality
Close-in-Range (Early/Strict) (0.65 / 0.80) — 0.80 = close in top 20% of bar.

Options
Fire intrabar (ON = earlier PRE/BRK; OFF = bar-close only).
Plot Signal Labels (on/off).
Debug paints (show/hide squeeze tint, volume dots, breakout carets, PRE).
Alerts (set these, you’re done)
Create two alerts from the indicator’s Condition dropdown:

BRK-SQZ Pre-Signal
Trigger: Once per bar (for early pings).
Purpose: tells you the coil is heating up before the rip.

BRK-SQZ Long
Trigger: Once per bar close (clean confirmation) or Once per bar if you want it faster.
Purpose: confirms the breakout when all checks align.

How to trade it (framework, not rules)
First touch after a long squeeze is the highest-odds signal.
On Daily, manage risk with ATR or a structure stop under the base.
Scale out into strength; let a runner ride if the squeeze was multi-week.

Installation (60 seconds)
Add indicator.
Keep Mode = Early, Fire intrabar = ON.
Set alerts for Pre-Signal (Once per bar) and Long (Once per bar close).
Save inputs as a Template and apply across your watchlist.

FAQ
Q: Why did PRE fire but no BRK?
A: One of the four checks failed at close (often volume or close-placement). That’s the filter doing its job.

Q: I want even earlier signals.
A: Lower volMult_early, reduce brkLen, or enable intrabar signals. Expect more noise.

Q: Can I get bearish signals?
A: Not yet. I can ship a mirrored Breakdown version on request.

Q: Can I screen a whole watchlist?
A: This version is chart-based. I can add a mini screener panel with a consolidated alert if you want.

Changelog
v6.1 — Early/Strict modes, PRE (3-of-4), squeeze tint, volume dots, breakout carets, BRK triangle, intrabar option, two alert conditions.

Disclaimer
This is a tool, not advice. Markets slip, wick, and change regime. Size responsibly and test your settings on your market/timeframe.



Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.