PROTECTED SOURCE SCRIPT
Fair Value Gap Clever Mode

The Pine Script indicator named "Fair Value Gap Clever Mode" is a market structure and supply/demand analysis tool built around concepts popular in the ICT (Inner Circle Trader) methodology, specifically Fair Value Gaps (FVGs) and Order Blocks (OBs).
It automatically identifies, plots, and manages these institutional trading zones on your chart, dynamically removing them once they have been "filled" or mitigated by price action.
Core Functionality and Concepts
The indicator uses classic smart money concepts (SMC) to highlight potential areas of interest for institutional flow:
Fair Value Gaps (FVGs): This is the primary feature. An FVG is an inefficiency in the market where the price moved rapidly in one direction, leaving a gap between the wick of the first candle and the wick of the third candle. The script colors these areas:
Bullish FVGs (potential support/buy zones) are marked with lime green boxes.
Bearish FVGs (potential resistance/sell zones) are marked with red boxes.
Crucially, these boxes are deleted from the chart if the price returns to fill the gap, indicating that the inefficiency has been mitigated.
Order Blocks (OBs): The script also identifies single-candle order blocks that occur within an FVG structure. These represent specific areas where large institutional orders may have been placed.
Bullish OBs (buy zones) are marked with teal boxes.
Bearish OBs (sell zones) are marked with orange boxes.
Unlike FVGs, Order Blocks persist on the chart for a fixed duration (obExtendBars = 15 bars) and are used as more precise entry points within the broader FVG zone.
Market Structure Shifts (BoS and ChoCH): The script tracks swing highs and lows and plots lines to indicate shifts in market structure:
Break of Structure (BoS): When the price confidently breaches a previous swing high (in an uptrend) or swing low (in a downtrend), it confirms the continuation of the current trend direction. These are marked with dotted lines.
Change of Character (ChoCH): When the price breaks a swing point that runs counter to the prevailing immediate structural bias, it signals a potential reversal or significant shift in trend. These are marked with solid lines.
How to Use It
This indicator is a powerful visualization tool for traders using SMC principles:
Identify Trade Setups: Look for price action to return into the marked FVG or OB zones. These zones act as magnets for price and often serve as precise entry points for trades in the direction of the overall market structure.
BTCUSD 
EURCHF 
AUDJPY
USOIL 
GBPMXN
XAUUSD
Confirm Mitigation: The automatic deletion of FVGs is a key feature. An unfilled FVG indicates an imbalance that the market is likely to revisit; a filled gap is a 'used' zone that is less likely to hold subsequent moves.
Gauge Trend Strength: Use the BoS (Break of Structure) lines to confirm trend health and the ChoCH (Change of Character) lines to watch for potential reversals.
It automatically identifies, plots, and manages these institutional trading zones on your chart, dynamically removing them once they have been "filled" or mitigated by price action.
Core Functionality and Concepts
The indicator uses classic smart money concepts (SMC) to highlight potential areas of interest for institutional flow:
Fair Value Gaps (FVGs): This is the primary feature. An FVG is an inefficiency in the market where the price moved rapidly in one direction, leaving a gap between the wick of the first candle and the wick of the third candle. The script colors these areas:
Bullish FVGs (potential support/buy zones) are marked with lime green boxes.
Bearish FVGs (potential resistance/sell zones) are marked with red boxes.
Crucially, these boxes are deleted from the chart if the price returns to fill the gap, indicating that the inefficiency has been mitigated.
Order Blocks (OBs): The script also identifies single-candle order blocks that occur within an FVG structure. These represent specific areas where large institutional orders may have been placed.
Bullish OBs (buy zones) are marked with teal boxes.
Bearish OBs (sell zones) are marked with orange boxes.
Unlike FVGs, Order Blocks persist on the chart for a fixed duration (obExtendBars = 15 bars) and are used as more precise entry points within the broader FVG zone.
Market Structure Shifts (BoS and ChoCH): The script tracks swing highs and lows and plots lines to indicate shifts in market structure:
Break of Structure (BoS): When the price confidently breaches a previous swing high (in an uptrend) or swing low (in a downtrend), it confirms the continuation of the current trend direction. These are marked with dotted lines.
Change of Character (ChoCH): When the price breaks a swing point that runs counter to the prevailing immediate structural bias, it signals a potential reversal or significant shift in trend. These are marked with solid lines.
How to Use It
This indicator is a powerful visualization tool for traders using SMC principles:
Identify Trade Setups: Look for price action to return into the marked FVG or OB zones. These zones act as magnets for price and often serve as precise entry points for trades in the direction of the overall market structure.
Confirm Mitigation: The automatic deletion of FVGs is a key feature. An unfilled FVG indicates an imbalance that the market is likely to revisit; a filled gap is a 'used' zone that is less likely to hold subsequent moves.
Gauge Trend Strength: Use the BoS (Break of Structure) lines to confirm trend health and the ChoCH (Change of Character) lines to watch for potential reversals.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, ücretsiz ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgiyi buradan edinebilirsiniz.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, ücretsiz ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgiyi buradan edinebilirsiniz.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.