OPEN-SOURCE SCRIPT
Fractals & Sweep

The Fractals & Sweep indicator is designed to identify key market structure points (fractals) and detect potential liquidity sweeps around those areas. It visually highlights both Bill Williams fractals and regular fractals, and alerts the user when the market sweeps liquidity above or below the most recent fractal levels.
Fractal Recognition:
Detects both bullish (low) and bearish (high) fractals on the price chart.
Users can choose between:
Bill Williams fractal logic (default), or
Regular fractal logic (when the “Filter Bill Williams Fractals” option is enabled).
Fractals are plotted directly on the chart as red downward triangles for highs and green upward triangles for lows.
Fractal Tracking:
The indicator stores the most recent high and low fractal levels to serve as reference points for potential sweep detection.
Sweep Detection:
A bearish sweep is triggered when the price wicks above the last fractal high but closes below it — suggesting a liquidity grab above resistance.
A bullish sweep is triggered when the price wicks below the last fractal low but closes above it — suggesting a liquidity grab below support.
When a sweep occurs, the indicator draws a horizontal line from the previous fractal point to the current bar.
Alert System:
Custom alerts notify the trader when a bearish sweep or bullish sweep occurs, allowing for timely reactions to potential reversals or liquidity traps.
Fractal Recognition:
Detects both bullish (low) and bearish (high) fractals on the price chart.
Users can choose between:
Bill Williams fractal logic (default), or
Regular fractal logic (when the “Filter Bill Williams Fractals” option is enabled).
Fractals are plotted directly on the chart as red downward triangles for highs and green upward triangles for lows.
Fractal Tracking:
The indicator stores the most recent high and low fractal levels to serve as reference points for potential sweep detection.
Sweep Detection:
A bearish sweep is triggered when the price wicks above the last fractal high but closes below it — suggesting a liquidity grab above resistance.
A bullish sweep is triggered when the price wicks below the last fractal low but closes above it — suggesting a liquidity grab below support.
When a sweep occurs, the indicator draws a horizontal line from the previous fractal point to the current bar.
Alert System:
Custom alerts notify the trader when a bearish sweep or bullish sweep occurs, allowing for timely reactions to potential reversals or liquidity traps.
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.