OPEN-SOURCE SCRIPT

Auto Fair Value Gap (FVG) Pro [identityKa]

1 338
Overview
The Auto Fair Value Gap (FVG) Pro [identityKa] is an essential Smart Money Concepts (SMC) tool engineered to detect and highlight institutional price imbalances. An FVG occurs when strong momentum creates a gap in price delivery, leaving an inefficiency between buyers and sellers. This script mathematically identifies these 3-bar structures in real-time, plotting them as dynamic zones. It goes a step further by offering automated chart mitigation (cleaning) and plotting the highly sought-after 50% Consequent Encroachment (CE) level.

Core Detection & Mitigation Mechanics
The algorithm evaluates price action strictly based on a 3-candle sequence:

Bullish FVG (Demand Imbalance): Identified when the Low of the 3rd candle is strictly higher than the High of the 1st candle, and the 2nd candle is bullish. This creates an unmitigated gap of buy-side liquidity.

Bearish FVG (Supply Imbalance): Identified when the High of the 3rd candle is strictly lower than the Low of the 1st candle, and the 2nd candle is bearish. This creates a sell-side imbalance.

Smart Mitigation (Wick vs. Close): The script allows the user to define what constitutes a "filled" gap. In "Wick" mode, the gap is instantly deleted from the chart the moment a subsequent candle's wick sweeps through the zone. In "Close" mode, the gap remains active until a candle's body strictly closes inside or beyond the zone, ensuring the chart stays clean and only relevant institutional targets remain visible.

The Consequent Encroachment (50% CE)
Institutions frequently target the exact middle of an imbalance. By default, this script draws a dashed line at the exact 50% mathematical equilibrium of every active FVG box. This serves as a precise entry point or target for advanced SMC traders.

HUD Dashboard & AI Logic
The integrated panel provides an instant read on the imbalance bias and risk state:

Dangerous: Displayed whenever the current live price action enters an active FVG zone. This signifies that the gap is actively being filled and high volatility is expected as orders are absorbed.

LONG: Triggered when the last detected FVG was Bullish, indicating that recent institutional momentum was upward and unmitigated demand zones lie below as support.

SHORT: Triggered when the last detected FVG was Bearish, indicating a dominance in sell-side momentum.

How to Use It
This tool is exceptionally powerful for Price Action trading, particularly on 15-minute and 1-hour timeframes where intraday institutional gaps frequently occur and are reliably filled. Traders should not blindly buy or sell when an FVG forms. Instead, use the FVG boxes as high-probability reversal zones. When the AI Suggestion reads "Dangerous" (price is inside the gap), monitor the price action on a lower timeframe. Wait for a rejection from the box—specifically near the 50% CE dashed line—before executing a trade in the direction of the macro trend.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.