OPEN-SOURCE SCRIPT
Updated FVG_SWG

FVG Liquidity & Gaps is a high-performance technical analysis tool built on the principles of Smart Money Concepts (SMC). This script integrates a dual-layer visualization system to track institutional order flow by identifying extreme liquidity zones (Swings) and price imbalances (Fair Value Gaps) in a single, unified panel.
The standout feature of this tool is its Dynamic Mitigation Engine, which physically resizes imbalance boxes as price interacts with them, providing a real-time view of remaining unfilled liquidity.
Key Features:
1. Liquidity Swings with Volume Analysis
Automatic Detection: Instantly identifies significant fractal highs and lows (Pivot High/Low).
Quantitative Insights: Each liquidity level includes a label displaying the Accumulated Volume or Touch Count within that zone. This helps traders distinguish between "weak" retail levels and "high-conviction" institutional walls.
Dynamic Projections: Liquidity lines remain solid while active and transition to a dashed style once the level is "purged" (swept), maintaining a clean structural history of the market.
2. Intelligent Fair Value Gaps (FVG)
Imbalance Visualization: Automatically detects and plots Bullish and Bearish Fair Value Gaps.
Mitigation Reduction (isFvgReduce): This "pro-level" feature automatically shrinks the FVG boxes as price fills the gap. If a wick enters 50% of an FVG, the box resizes to show only the remaining 50% that is yet to be mitigated.
Optimized Memory: Includes a history manager to limit the number of active gaps, ensuring the chart remains focused on the most relevant current action.
How to Trade with this Script:
Liquidity Sweeps (Stop Hunts): Monitor the Swing levels for potential sweeps. When price breaks a high-volume liquidity line and quickly rejects, it provides a high-probability reversal signal.
Order Block & Inefficiency Entry: Use the unfilled (or partially reduced) FVG boxes as targets or entry zones where the market is likely to seek balance.
Noise Filtering: Adjust the Filter Min Value to only display labels on liquidity levels that have seen significant trading activity—ideal for high-volatility assets like Nasdaq (NAS100), Gold (XAUUSD), or Crypto.
Technical Configuration:
Pivot Lookback: Define the sensitivity of market structure.
Swing Area: Choose between measuring only the mecha (Wick Extremity) or the Full Range for liquidity volume calculations.
Custom Aesthetics: Fully customizable colors to match any UI theme (Dark/Light modes).
The standout feature of this tool is its Dynamic Mitigation Engine, which physically resizes imbalance boxes as price interacts with them, providing a real-time view of remaining unfilled liquidity.
Key Features:
1. Liquidity Swings with Volume Analysis
Automatic Detection: Instantly identifies significant fractal highs and lows (Pivot High/Low).
Quantitative Insights: Each liquidity level includes a label displaying the Accumulated Volume or Touch Count within that zone. This helps traders distinguish between "weak" retail levels and "high-conviction" institutional walls.
Dynamic Projections: Liquidity lines remain solid while active and transition to a dashed style once the level is "purged" (swept), maintaining a clean structural history of the market.
2. Intelligent Fair Value Gaps (FVG)
Imbalance Visualization: Automatically detects and plots Bullish and Bearish Fair Value Gaps.
Mitigation Reduction (isFvgReduce): This "pro-level" feature automatically shrinks the FVG boxes as price fills the gap. If a wick enters 50% of an FVG, the box resizes to show only the remaining 50% that is yet to be mitigated.
Optimized Memory: Includes a history manager to limit the number of active gaps, ensuring the chart remains focused on the most relevant current action.
How to Trade with this Script:
Liquidity Sweeps (Stop Hunts): Monitor the Swing levels for potential sweeps. When price breaks a high-volume liquidity line and quickly rejects, it provides a high-probability reversal signal.
Order Block & Inefficiency Entry: Use the unfilled (or partially reduced) FVG boxes as targets or entry zones where the market is likely to seek balance.
Noise Filtering: Adjust the Filter Min Value to only display labels on liquidity levels that have seen significant trading activity—ideal for high-volatility assets like Nasdaq (NAS100), Gold (XAUUSD), or Crypto.
Technical Configuration:
Pivot Lookback: Define the sensitivity of market structure.
Swing Area: Choose between measuring only the mecha (Wick Extremity) or the Full Range for liquidity volume calculations.
Custom Aesthetics: Fully customizable colors to match any UI theme (Dark/Light modes).
Release Notes
Visual Update:Fixed color scheme for better contrast and clarity. Key components like Liquidity Level Mitigation and Dynamic FVG Reduction are now clearly identified in the publication chart to ensure the script's output is easily recognizable, following House Rules for chart legibility.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.