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.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.