OPEN-SOURCE SCRIPT
Fib Sweep Structure

Fib Sweep Structure
This indicator combines three concepts into a single workflow: liquidity sweeps, break of structure (BOS), and Fibonacci retracement zones with internal structure tracking.
What it does
When price breaks a major swing high or low, the indicator draws a Fib retracement between the breakout level and the most recent opposing swing. The 0.25, 0.50, and 0.75 levels are plotted as a discount/premium zone for entries on the pullback. Inside that zone, smaller pivot breaks are flagged as internal structure shifts so you can time entries against confirmed minor momentum.
Liquidity sweeps are tracked independently. Pivot highs and lows are monitored for wicks (failed breakouts) and outbreak-and-retest patterns. Each sweep prints a colored box marking the sweep area, which extends until price closes through it.
How to use it
Wait for a BOS in the direction you want to trade. Once the Fib zone prints, look for price to retrace into the 0.5 to 0.75 region. Use the internal structure shifts as confirmation that momentum is turning in the direction of the original BOS. Liquidity sweeps inside or near the zone add confluence.
Settings
- Sweeps Length: lookback for the swing points used in liquidity sweep detection
- Options: choose between wick sweeps only, outbreak and retest only, or both
- Sweep Area: toggle extension of sweep boxes and set max bar length
- BOS Structure Length: lookback for major structure pivots. Larger values isolate higher timeframe structure
- Internal Structure Length: lookback for the minor shifts plotted inside the active Fib zone. Keep this smaller than the BOS length
Notes
Only the most recent BOS and its Fib zone are active at any time. A new BOS clears the previous Fib levels and internal shift lines. Internal shift lines are static and stop at the bar where the break occurred, so they read as historical signals rather than ongoing levels.
Credits
Built on top of the open-source Liquidity Sweeps logic by LuxAlgo, released under the Mozilla Public License 2.0. The BOS detection, Fibonacci zone generation, and internal structure tracking are additions to that base.
This indicator combines three concepts into a single workflow: liquidity sweeps, break of structure (BOS), and Fibonacci retracement zones with internal structure tracking.
What it does
When price breaks a major swing high or low, the indicator draws a Fib retracement between the breakout level and the most recent opposing swing. The 0.25, 0.50, and 0.75 levels are plotted as a discount/premium zone for entries on the pullback. Inside that zone, smaller pivot breaks are flagged as internal structure shifts so you can time entries against confirmed minor momentum.
Liquidity sweeps are tracked independently. Pivot highs and lows are monitored for wicks (failed breakouts) and outbreak-and-retest patterns. Each sweep prints a colored box marking the sweep area, which extends until price closes through it.
How to use it
Wait for a BOS in the direction you want to trade. Once the Fib zone prints, look for price to retrace into the 0.5 to 0.75 region. Use the internal structure shifts as confirmation that momentum is turning in the direction of the original BOS. Liquidity sweeps inside or near the zone add confluence.
Settings
- Sweeps Length: lookback for the swing points used in liquidity sweep detection
- Options: choose between wick sweeps only, outbreak and retest only, or both
- Sweep Area: toggle extension of sweep boxes and set max bar length
- BOS Structure Length: lookback for major structure pivots. Larger values isolate higher timeframe structure
- Internal Structure Length: lookback for the minor shifts plotted inside the active Fib zone. Keep this smaller than the BOS length
Notes
Only the most recent BOS and its Fib zone are active at any time. A new BOS clears the previous Fib levels and internal shift lines. Internal shift lines are static and stop at the bar where the break occurred, so they read as historical signals rather than ongoing levels.
Credits
Built on top of the open-source Liquidity Sweeps logic by LuxAlgo, released under the Mozilla Public License 2.0. The BOS detection, Fibonacci zone generation, and internal structure tracking are additions to that base.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.