ICT-FPFVG

1. Overview

Based on Inner Circle Trader (ICT) algorithmic price action theory, this indicator specifically targets the First Presented Fair Value Gap (FPFVG) that forms immediately after the start of a Time-Range or trading Session (such as the New York AM Open).
This First Presented FVG represents a significant imbalance in price delivery. Identifying the initial displacement gap can play a crucial role in framing future price movements, acting as a primary draw on liquidity or a high-probability point of support/resistance for the session.


2. Logic

2.1. First Imbalance Detection
The script automatically scans price action right after a chosen session or time-range begins. It independently detects and plots only the first confirmed gap—whether it is a Fair Value Gap (FVG), Volume Imbalance (VI), or Liquidity Void (LV). Each configured session independently tracks its first imbalance.

2.2. Intelligent Replacement System
Not all first gaps are equal. The script features an advanced "Prioritize Displacement" engine that allows stronger, more obvious FVGs to replace earlier, weaker ones within the same session.
  • Grace Period: Protects the first FVG for a configurable duration after the session starts to prevent immediate replacement.
  • Superiority Factor: Requires any new FVG candidate to exceed the existing plotted gap by a specified multiple to trigger a replacement.
  • Time Decay (λ): Penalizes older or smaller gaps over time, ensuring only truly dominant displacements take over.
  • ATR Normalization: Normalizes gaps across different volatility regimes to ensure fair comparison.

2.3. Advanced Range Filtering
To filter out market noise and insignificant gaps, the Minimum-Range-Filter (MRF) ensures only gaps that meet a required size (in points) are processed. This can be run globally or customized per session.


3. Settings & Options

3.1. Analysis Mode & Timeframe
  • Analysis Mode: Toggle between specific "Time Ranges" (45 predefined 30-min intervals + 8 pre-labeled ICT Open Ranges) or "Sessions" (6 predefined ICT sessions like Midnight, NY AM, L-SB, etc., plus 3 custom slots).
  • Timeframe (MTF): Option to lock the timeframe to visualize FPFVGs from a lower timeframe on a higher timeframe chart.

3.2. Imbalances Settings
  • Imbalance Types: Toggle visibility for FVGs, Volume Imbalances (VI), and Liquidity Voids (LV).
  • Include Open/Close: Allows candle bodies to define gap boundaries (useful for suspension blocks).
  • Imbalance Levels: Toggle Consequent Encroachment (CE), Quadrants (25%/75%), and Eighths (12.5%/87.5%). Includes minimum range filters so levels only plot on larger gaps.

3.3. Imbalances Replacement
  • Prioritize Displacement: Enables the intelligent FVG replacement system.
  • Keep Replaced FVGs: Retains replaced gaps on the chart using a distinct color for reference.
  • Tuning Parameters: Fully adjustable Decay (λ), Grace Period, Superiority Factor, and ATR Normalization.

3.4. Minimum-Range-Filters (MRF)
  • Mode: Choose between "Single MRF" (one global size filter) or "Multi-MRF" (session-specific minimum sizes).
  • Session-Specific Filters: Customize minimum point requirements individually for RTH NY-AM, RTH NY-PM, ETH London, ETH Asia, etc.

3.5. Extension & History
  • Extend Imbalances: Choose how far gaps extend (None, Session End, Day End, Week End).
  • Monday FFVG: Special handling option to extend Monday's first FVG through the entire trading week.
  • Previous Imbalances: Control how many past days of historical imbalances are kept on the chart.

3.6. Imbalance Labels & Boundaries
  • Labels: Highly customizable text. Show date, time, and type. Custom formatting allows pattern building (e.g., "{date} {time24} {type}").
  • Session Boundaries: Visual vertical lines denoting session start/end, accompanied by ATR-scaled session titles above price action.
  • Styling: Render gaps as solid "Blocks" or outline "Lines". Fully customizable colors, borders, and dash styles for current, previous, and replaced gaps.

3.7. Alerts
  • New Imbalances: Alerts when a new FPFVG is created.
  • Replacements: Alerts when an imbalance is replaced by a stronger displacement.
  • Retracements: Alerts when price retraces back into a plotted imbalance for the first time. Supports filtering by current vs. all gaps.
  • Format: Outputs plain text or structured JSON for webhook automations.