OPEN-SOURCE SCRIPT
Updated First FVG Custom Time Range

First FVG — Opening Range Fair Value Gap Detector
Smart Money Opening Imbalance Strategy Tool
This script automatically detects and highlights the first Fair Value Gap (FVG) that forms between 9:30 and 10:00 AM Eastern Time (New York session open) — a critical period often referred to as the Opening Range. It’s designed for Smart Money traders looking to isolate early-morning inefficiencies that may influence market behavior throughout the trading day.
🔍 What This Script Does:
Automatically Detects the First FVG in the Opening Range
Scans price action between 9:30 and 10:00 AM ET and identifies the first valid bullish or bearish FVG that forms.
Only one FVG is shown per day — ensuring a clean, focused view.
Draws a Visual Zone
Once detected, the FVG zone is extended forward on the chart (customizable duration).
A labeled zone helps users track how price reacts to it throughout the session.
Optional Retest Alerts
Alerts you when price re-enters the zone — a potential reaction point used by SMC traders.
Customization Options
Set your preferred session time window
Adjust zone duration (in bars)
Customize label font size, colors, and visibility
Enable/disable alert on retest
📈 Why the First FVG Matters:
Time-Sensitive Setup: The first FVG typically forms no earlier than 9:31 AM ET and represents a potential “time distortion” or imbalance zone created by aggressive market participants during the open.
Behavioral Study: Many traders journal how price behaves around this zone each day — whether it acts as support, resistance, or gets traded through later in the session.
Predictive Value: Observing how this zone is respected or broken can provide anticipatory insight into intraday price action, rather than reactive analysis.
Great for New Traders: This opening FVG is often recommended as a starting reference point for building trade models and understanding how institutional imbalances unfold.
🚀 What Makes It Unique:
This tool doesn’t spam your chart with every FVG. It laser-focuses on a single, time-bound zone backed by institutional logic — the first presented imbalance of the day during the opening range.
Use it to:
Monitor price behavior around early inefficiencies
Plan journal entries and pattern recognition
Align intraday setups with a high-probability SMC model
Whether you’re scalping, journaling market structure, or refining entries based on liquidity behavior — this script helps you make the first 30 minutes count.
Smart Money Opening Imbalance Strategy Tool
This script automatically detects and highlights the first Fair Value Gap (FVG) that forms between 9:30 and 10:00 AM Eastern Time (New York session open) — a critical period often referred to as the Opening Range. It’s designed for Smart Money traders looking to isolate early-morning inefficiencies that may influence market behavior throughout the trading day.
🔍 What This Script Does:
Automatically Detects the First FVG in the Opening Range
Scans price action between 9:30 and 10:00 AM ET and identifies the first valid bullish or bearish FVG that forms.
Only one FVG is shown per day — ensuring a clean, focused view.
Draws a Visual Zone
Once detected, the FVG zone is extended forward on the chart (customizable duration).
A labeled zone helps users track how price reacts to it throughout the session.
Optional Retest Alerts
Alerts you when price re-enters the zone — a potential reaction point used by SMC traders.
Customization Options
Set your preferred session time window
Adjust zone duration (in bars)
Customize label font size, colors, and visibility
Enable/disable alert on retest
📈 Why the First FVG Matters:
Time-Sensitive Setup: The first FVG typically forms no earlier than 9:31 AM ET and represents a potential “time distortion” or imbalance zone created by aggressive market participants during the open.
Behavioral Study: Many traders journal how price behaves around this zone each day — whether it acts as support, resistance, or gets traded through later in the session.
Predictive Value: Observing how this zone is respected or broken can provide anticipatory insight into intraday price action, rather than reactive analysis.
Great for New Traders: This opening FVG is often recommended as a starting reference point for building trade models and understanding how institutional imbalances unfold.
🚀 What Makes It Unique:
This tool doesn’t spam your chart with every FVG. It laser-focuses on a single, time-bound zone backed by institutional logic — the first presented imbalance of the day during the opening range.
Use it to:
Monitor price behavior around early inefficiencies
Plan journal entries and pattern recognition
Align intraday setups with a high-probability SMC model
Whether you’re scalping, journaling market structure, or refining entries based on liquidity behavior — this script helps you make the first 30 minutes count.
Release Notes
📘 First FVG (Multiple, Extend, Custom Time)This advanced Smart Money Concept (SMC) indicator detects and tracks the first few Fair Value Gaps (FVGs) within a customizable intraday time window — ideal for traders looking to identify displacement-based imbalances early in the session. Unlike basic FVG detectors, this script supports multiple zones per day and infinite box extensions, allowing for both dynamic visualization and long-term tracking of price reaction levels.
🔍 What It Does
Identifies bullish and bearish FVGs using standard ICT-style logic (low[1] > high[3] and high[1] < low[3]).
Limits detection to a user-defined time range (e.g., 9:30–10:30 ET) — perfect for Kill Zones or AM sessions.
Draws up to 14 FVGs per day, with each one extending to the right indefinitely.
Labels each FVG with optional text like:
FVG #1
FVG + OB #2 (if displacement-based Order Block confluence is detected)
Includes alerts for when price retests any active FVG zone.
⚙️ Customizable Inputs
⏱️ Time Window: Define start and end time for FVG scanning (in ET).
🔁 Max FVGs per Day: Control how many FVGs are allowed to appear daily.
🎯 Label Settings: Configure label color, size, and text visibility.
🚨 Alerts: Trigger notifications when price reenters an active FVG zone.
🧠 How It Works
The script scans for early-session displacements, then tracks the first N gaps that form. It stores each zone in arrays, allowing the user to manage multiple active FVGs simultaneously and detect precise market reactions when price re-touches those levels. Labels help distinguish zones, and an optional alert ensures you're notified of any key retests.
✅ Best Used With
ICT Macro Zones (for session context)
Liquidity Grabs + OB indicators
Kill Zone-based scalping or reversal models
Release Notes
📘 Script Name: First FVG (Numbered, Extend, Track Retest)🧠 What This Script Does
This script identifies and tracks Fair Value Gaps (FVGs) that occur within a trader-defined time window. It is designed for traders who rely on displacement-based imbalances, particularly those studying Smart Money Concepts (SMC) and ICT methodologies.
The script automatically marks the first few FVGs of each session, tracks whether price has returned to those zones (a “retest”), and offers visual + alert-based feedback.
🧮 How It Works (Conceptually)
This script is based on the principle of 3-bar imbalance detection, where:
A bullish FVG forms when the low of the middle bar is higher than the high of the third bar back.
A bearish FVG forms when the high of the middle bar is lower than the low of the third bar back.
These conditions suggest a temporary inefficiency or gap in liquidity, often followed by price revisiting those zones. The script:
Captures only the first few FVGs per day to avoid clutter (you control the limit).
Labels each FVG numerically (e.g., FVG #1, FVG #2) for clarity.
Optionally highlights order block confluence, when FVGs coincide with displacement candles (based on defined OB logic).
Visually marks FVGs as “retested” once price returns to them.
🔧 Inputs & Customization
Users can configure:
Time Range (ET): Define the active FVG detection window.
Max FVGs per Day: Avoid chart overload by limiting detected zones.
Box & Label Colors: Change colors for both fresh and retested zones.
Font Size & Label Positioning: Customize how labels appear.
Alerts: Trigger when price reenters any active FVG.
🔍 Why This Is Unique
While many open-source indicators detect FVGs, this script stands out because:
It limits detection to the most critical time period of the day.
It tracks individual FVGs persistently, not just the latest one.
Each FVG is tagged, visually updated, and alert-enabled upon interaction with price.
A summary table provides real-time feedback on active and retested zones.
This combination of time-restricted logic, per-session tracking, and visual feedback ensures traders are focused only on the most meaningful imbalances.
🧭 How To Use It
Apply this on 1m to 15m charts for optimal visibility.
Set your desired FVG window (e.g., 9:30–9:45AM ET).
Watch for price to return to one of the active FVGs.
Use the legend to track which zones have already been retested (marked ✅).
Combine with your broader Smart Money strategy or ICT kill zone models.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.