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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.