OPEN-SOURCE SCRIPT
Bull/Bear FVG Density Ratio

This indicator tracks the directional frequency of Fair Value Gaps (FVGs) over a configurable lookback window, offering a clean, responsive measure of market imbalance.
🔍 What It Does:
Detects bullish and bearish FVGs using a 3-bar displacement logic
Calculates the ratio of FVGs to candles over the last N bars
Plots separate density curves for bullish and bearish FVGs
Includes a threshold line to help identify regime shifts (e.g., drought vs spate)
📈 How to Use:
Use rising density to confirm trend strength or breakout momentum
Watch for crossovers above the threshold to signal active imbalance regimes
Combine with price action or volume overlays for high-confluence setups
⚙️ Inputs:
Lookback Window: Number of candles used to calculate FVG density
Threshold: Visual guide for regime classification (default: 0.2)
This tool is ideal for traders who want to move beyond symptomatic signals and model structural causality. It pairs well with lifecycle scoring, retest velocity, and HTF overlays.
🔍 What It Does:
Detects bullish and bearish FVGs using a 3-bar displacement logic
Calculates the ratio of FVGs to candles over the last N bars
Plots separate density curves for bullish and bearish FVGs
Includes a threshold line to help identify regime shifts (e.g., drought vs spate)
📈 How to Use:
Use rising density to confirm trend strength or breakout momentum
Watch for crossovers above the threshold to signal active imbalance regimes
Combine with price action or volume overlays for high-confluence setups
⚙️ Inputs:
Lookback Window: Number of candles used to calculate FVG density
Threshold: Visual guide for regime classification (default: 0.2)
This tool is ideal for traders who want to move beyond symptomatic signals and model structural causality. It pairs well with lifecycle scoring, retest velocity, and HTF overlays.
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.