PROTECTED SOURCE SCRIPT

Chop Zones with confirmation (Version 2)

73
Time-Locked Consolidation Zones (Confirmed, No Overlap)

This indicator automatically detects and marks consolidation zones where price trades tightly for a defined period, then highlights only those zones that break with full confirmation.

🔹 How it works:

Detects tight price-only ranges based on your custom time and height limits.
Draws a pending zone while price stays contained.
Waits for a breakout → requires the next candle’s full body to confirm direction.
Locks the zone permanently once confirmed (no overlap with prior zones).
Adds clear labels and alerts for confirmed breakouts or breakdowns.

🔹 Why use it:

Filters out fakeouts and wick-based breaks.
Confirms momentum before signaling.
Keeps charts clean with non-overlapping, verified zones.
Works on any timeframe or instrument.
Perfect for breakout traders who want high-probability setups built on structure and confirmation.

🔹 Purpose

The script identifies price-only consolidation ranges that last a minimum time period, then waits for a confirmed breakout before permanently locking in that zone. It helps traders spot accumulation/distribution phases and trade breakouts with stronger confirmation.

🔹 Core Logic
1. Finding Consolidation Windows

User sets a minimum number of minutes (minMins) that price must stay in a range.
This is converted into bars (barsNeeded) based on the current chart timeframe.
The highest high and lowest low of that rolling window are tracked.
If the total range (hh - ll) is below a user-defined cap (maxRangePts in points OR maxRangePct of price), the zone is considered “tight” enough.
2. Pending Zone Creation
When a new tight range is detected, and no other zone is in cooldown or awaiting confirmation, the script starts a pending zone box (yellow by default).
The box tracks:
Top/bottom of the range (high/low).
Left/right time boundaries (from the first bar in the window to the current bar).
While pending:
The box extends to include each new bar.
A “touch counter” tracks how many times price hits the edges (optional filter).
3. Breakout Detection
A breakout is defined as a bar whose close is outside the pending zone (not just a wick).
At that point, the script goes into confirmation mode:
It remembers the direction (+1 for breakout up, -1 for breakout down).
It waits one more bar.
4. Confirmation Rule
The very next bar must have a full body completely outside the zone in the breakout direction:
Up breakout: both open and close are above the zone top.
Down breakout: both open and close are below the zone bottom.
If confirmed:
The pending box becomes locked (teal by default).
It cannot overlap in both time and price with an existing locked box.
It is added permanently to the lockedBoxes array.
A cooldown period starts (so it won’t immediately draw another).
If not confirmed:
The zone remains pending and extends forward.
5. Overlap Control
The script ensures zones don’t overlap:
Both in time (a new zone cannot start inside the time span of the last zone).
And in price (locked zones cannot overlap vertically with another).
If overlap would occur, the pending zone is discarded.
6. Alerts & Labels
On the confirmation bar (the breakout bar after validation), the script plots:
Up label above the bar for confirmed breakouts.
Down label below the bar for confirmed breakdowns.
Alerts are available for both breakout and breakdown events.
🔹 Key Inputs & Customization
Minimum minutes in range (minMins).
Max height of range: either in points (maxRangePts) or percentage (maxRangePct).
Cooldown bars before a new zone can form.
Minimum touches on zone edges (optional).
Tolerance for what counts as a touch.
Colors for pending vs locked zones.
🔹 Visual Workflow
Price consolidates tightly for minMins.
A yellow box forms (pending).
A breakout bar closes outside the box → script waits for 1 more candle.
If that candle’s body is fully outside in the same direction → zone locks teal.
A label + alert fires: “Breakout confirmed ↑” or “Breakdown confirmed ↓”.
Zone is stored and won’t overlap with others.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.