OPEN-SOURCE SCRIPT
Whale Fractal Levels (V1.0)

What it does
This indicator plots Fractal Levels (Bill Williams pivots) as horizontal lines and prints clean signals for:
BO+ / BO− → Breakouts through the latest fractal high/low
SW↑ / SW↓ → Liquidity sweeps (wick pierces, close rejects)
RE+ / RE− → Retests of the broken level after a confirmed breakout
Cyan = support (fractal lows).
Lilac = resistance (fractal highs).
How it works
Detects fractals with Left/Right = lr. A pivot is confirmed after lr bars on the right → the level itself doesn’t repaint.
Each confirmed fractal spawns a horizontal line extended to the right. You can limit how many lines stay on chart and auto-expire old ones.
Signals reference the most recent fractal high/low only and are edge-triggered (crossover/crossunder) with a cooldown so you don’t get a marker on every bar near the level.
A small state machine remembers the last breakout to validate the next retest.
Inputs (Settings)
Fractals
Left/Right (BW fractal) — Sensitivity of pivots (lower = more reactive, higher = cleaner).
MAX number of levels to display — Keep only the most recent N lines.
Level lifetime (bars) — Auto-delete lines after N bars to declutter.
Signals
Cooldown between signals (bars) — Minimum spacing between markers (anti-spam).
Show Breakouts (BO±) — Toggle breakout markers.
Show Sweeps (SW↑/SW↓) — Toggle sweep markers.
Show Retests (RE±) — Toggle retest markers.
Display
Show fractal lines / Line width / Line transparency (0..100)
Alerts (ready to use)
BO+ (Fractal), BO- (Fractal)
SW↑ (Fractal), SW↓ (Fractal)
RE+ (Fractal), RE- (Fractal)
This indicator plots Fractal Levels (Bill Williams pivots) as horizontal lines and prints clean signals for:
BO+ / BO− → Breakouts through the latest fractal high/low
SW↑ / SW↓ → Liquidity sweeps (wick pierces, close rejects)
RE+ / RE− → Retests of the broken level after a confirmed breakout
Cyan = support (fractal lows).
Lilac = resistance (fractal highs).
How it works
Detects fractals with Left/Right = lr. A pivot is confirmed after lr bars on the right → the level itself doesn’t repaint.
Each confirmed fractal spawns a horizontal line extended to the right. You can limit how many lines stay on chart and auto-expire old ones.
Signals reference the most recent fractal high/low only and are edge-triggered (crossover/crossunder) with a cooldown so you don’t get a marker on every bar near the level.
A small state machine remembers the last breakout to validate the next retest.
Inputs (Settings)
Fractals
Left/Right (BW fractal) — Sensitivity of pivots (lower = more reactive, higher = cleaner).
MAX number of levels to display — Keep only the most recent N lines.
Level lifetime (bars) — Auto-delete lines after N bars to declutter.
Signals
Cooldown between signals (bars) — Minimum spacing between markers (anti-spam).
Show Breakouts (BO±) — Toggle breakout markers.
Show Sweeps (SW↑/SW↓) — Toggle sweep markers.
Show Retests (RE±) — Toggle retest markers.
Display
Show fractal lines / Line width / Line transparency (0..100)
Alerts (ready to use)
BO+ (Fractal), BO- (Fractal)
SW↑ (Fractal), SW↓ (Fractal)
RE+ (Fractal), RE- (Fractal)
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.