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)
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。