Fair Value Gap (FVG) & Imbalance Auto-Detector
100% Free Indicator
Platform both
Repainting Zero (Confirmed)
Timeframes M1 to Daily
Instruments Forex, Crypto, Gold
TradingView Pine Script (v5) MetaTrader 5 (.ex5/.mq5)

Fair Value Gap (FVG) & Imbalance Auto-Detector

Detects 3-candle price imbalances and ICT Fair Value Gaps (FVG) with real-time fill tracking and mitigation status.

Access Price
100% FREE No Subscription
★ 4.9 (Verified)
Direct access — zero checkout friction or card required
Includes complete Pine Script v5 open source & setup guide

TradingView Pine Script (v5) Source Code

Copy and paste this code directly into your TradingView Pine Editor

//@version=5
indicator("FxSnip - Fair Value Gap (FVG) Detector", "FxSnip FVG Detector", overlay=true, max_boxes_count=500)

// Inputs
minGapTicks = input.int(5, "Min Gap Size (Ticks)", minval=1)
showCE      = input.bool(true, "Show 50% Consequent Encroachment (CE)")
bullColor   = input.color(color.new(color.emerald, 75), "Bullish FVG Box Color")
bearColor   = input.color(color.new(color.rose, 75), "Bearish FVG Box Color")

// Bullish FVG: Low of candle 1 > High of candle 3
isBullFVG = low[0] > high[2] and (low[0] - high[2]) >= (minGapTicks * syminfo.mintick)
// Bearish FVG: High of candle 1 < Low of candle 3
isBearFVG = high[0] < low[2] and (low[2] - high[0]) >= (minGapTicks * syminfo.mintick)

if isBullFVG
    b = box.new(left=bar_index-2, top=low[0], right=bar_index+20, bottom=high[2], bgcolor=bullColor, border_color=color.emerald)
    if showCE
        mid = (low[0] + high[2]) / 2
        line.new(bar_index-2, mid, bar_index+20, mid, color=color.emerald, style=line.style_dotted)

if isBearFVG
    b = box.new(left=bar_index-2, top=low[2], right=bar_index+20, bottom=high[0], bgcolor=bearColor, border_color=color.rose)
    if showCE
        mid = (low[2] + high[0]) / 2
        line.new(bar_index-2, mid, bar_index+20, mid, color=color.rose, style=line.style_dotted)
1

How to Add to TradingView

  1. Click the "Copy Pine Script (v5)" button above.
  2. Open your chart on TradingView.com.
  3. Click the Pine Editor tab at the very bottom bar.
  4. Select and delete any default code, paste this script, and click "Save" → "Add to Chart".
2

How to Install in MetaTrader 5 (MT5)

  1. Click "Download MT5 Indicator" to save the .ex5 / .mq5 file.
  2. In MT5, click top menu File > Open Data Folder.
  3. Navigate to MQL5 > Indicators folder and paste the file.
  4. In MT5 Navigator window, right-click Indicators > Refresh, then drag it onto your chart.

Key Features & Algorithmic Logic

  • Instant 3-bar algorithmic FVG detection
  • 50% Consequent Encroachment (CE) midpoint line
  • Automatic mitigation removal or color fading
  • Multi-timeframe overlay compatibility
  • Non-repainting box rendering

Indicator Overview

The Fair Value Gap (FVG) Auto-Detector identifies high-probability liquidity imbalances formed when price moves aggressively in one direction, leaving an unfilled price void between Candle 1 and Candle 3.

Key Capabilities

  • Automatic FVG Box Rendering: Automatically projects bullish (green) and bearish (red) FVG zones to current price.
  • Mitigation / Fill Tracking: Dynamically adjusts box width when price fills or mitigates the gap (50% Consequent Encroachment).
  • Volume Threshold Filtering: Filters out low-volume minor gaps to focus on institutional expansion bars.

Recommended Settings

Best Timeframes: M5, M15, H1, H4
Pairs / Assets: EURUSD, GBPUSD, XAUUSD, BTC
Confirmation Rule: On Bar Close
Alerts: Push, Sound, Webhook

Need Custom Modifications?

Need this indicator converted into an automated MT5 Expert Advisor or customized for your specific trading rules?

Order Custom Coding →
TX

Loading activity...

Just now