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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。