OPEN-SOURCE SCRIPT
Zone of Interest (ZOI) - Fractals

Zone of Interest (ZOI) with Breakout Start/Exit Alerts
Overview
The Zone of Interest (ZOI) indicator identifies demand and supply zones based on fractal pivots and provides breakout alerts with Start/Exit signals for precise entry and exit interpretation.
Unlike basic breakout indicators that send alerts on every bar, this script ensures clean alerts only at breakout start and breakout end, making it ideal for traders who want clarity without alert spam.
Key Features
✔ Demand & Supply Zones:
Zones created from fractal pivots (swing highs/lows).
Auto-extend zones until expiry.
✔ Breakout Detection:
Detects bullish (price breaks above demand) and bearish (price breaks below supply) breakouts.
✔ Start & Exit Labels:
START LONG when bullish breakout begins.
EXIT LONG when bullish trend ends.
START SHORT when bearish breakout begins.
EXIT SHORT when bearish trend ends.
✔ Clean Alerts:
Alerts fire only on START and EXIT (not every bar).
✔ Visual Cues:
Triangles for every breakout bar (optional visual reference).
Green/Red background shading during active breakout phase.
Inputs
Input - Description
Fractal Length - Number of bars to confirm a fractal pivot.
Zone Expiry (Bars) - Maximum bars before a zone is removed.
Min Distance Between Zones (%) - Prevents overlapping zones by comparing midpoints.
How It Works
Uses fractal pivots to identify swing highs and lows.
Creates Supply Zones (red) from pivot highs and Demand Zones (green) from pivot lows.
Extends zones to the right until expiry or price action invalidates them.
Breakouts occur when price closes beyond the most recent zone boundary.
Tracks breakout phases and fires alerts only at Start and Exit.
✅ Example: How to Use
Suppose you're analyzing XAU/USD on a 15-minute chart:
Step 1: A green demand zone forms at 3344 – 3360.
Step 2: Price pulls back into the zone and starts moving higher.
Step 3: When price closes above 3360, the indicator triggers START LONG and shades the background green.
Step 4: You ride the trend while price remains above the zone.
Step 5: If price later falls back below 3360, an EXIT LONG label appears, and an alert fires.
✅ This helps you avoid spam alerts and focus on key breakout events.
Best Practices
Works well on 15m and higher timeframes.
Combine with trend confirmation (EMA, Supertrend) for better accuracy.
Designed for manual trading and alert-based setups, not automation.
Overview
The Zone of Interest (ZOI) indicator identifies demand and supply zones based on fractal pivots and provides breakout alerts with Start/Exit signals for precise entry and exit interpretation.
Unlike basic breakout indicators that send alerts on every bar, this script ensures clean alerts only at breakout start and breakout end, making it ideal for traders who want clarity without alert spam.
Key Features
✔ Demand & Supply Zones:
Zones created from fractal pivots (swing highs/lows).
Auto-extend zones until expiry.
✔ Breakout Detection:
Detects bullish (price breaks above demand) and bearish (price breaks below supply) breakouts.
✔ Start & Exit Labels:
START LONG when bullish breakout begins.
EXIT LONG when bullish trend ends.
START SHORT when bearish breakout begins.
EXIT SHORT when bearish trend ends.
✔ Clean Alerts:
Alerts fire only on START and EXIT (not every bar).
✔ Visual Cues:
Triangles for every breakout bar (optional visual reference).
Green/Red background shading during active breakout phase.
Inputs
Input - Description
Fractal Length - Number of bars to confirm a fractal pivot.
Zone Expiry (Bars) - Maximum bars before a zone is removed.
Min Distance Between Zones (%) - Prevents overlapping zones by comparing midpoints.
How It Works
Uses fractal pivots to identify swing highs and lows.
Creates Supply Zones (red) from pivot highs and Demand Zones (green) from pivot lows.
Extends zones to the right until expiry or price action invalidates them.
Breakouts occur when price closes beyond the most recent zone boundary.
Tracks breakout phases and fires alerts only at Start and Exit.
✅ Example: How to Use
Suppose you're analyzing XAU/USD on a 15-minute chart:
Step 1: A green demand zone forms at 3344 – 3360.
Step 2: Price pulls back into the zone and starts moving higher.
Step 3: When price closes above 3360, the indicator triggers START LONG and shades the background green.
Step 4: You ride the trend while price remains above the zone.
Step 5: If price later falls back below 3360, an EXIT LONG label appears, and an alert fires.
✅ This helps you avoid spam alerts and focus on key breakout events.
Best Practices
Works well on 15m and higher timeframes.
Combine with trend confirmation (EMA, Supertrend) for better accuracy.
Designed for manual trading and alert-based setups, not automation.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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.