First FVG Custom Time RangeFirst 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.
Ictfairvaluegap
FVGs & CEs + Alerts: simple & efficient methodFair Value Gap indicator: Paints FVGs and their midlines (CEs). Stops painting when CE is hit, or when fully filled; user choice of threshold. This threshold is also used in the Alert conditions.
~~Plotted here on ES1! (CME), on the 15m timeframe~~
-A FVG represents a 'naked' body where the wicks/tails on either side do not meet. This can be seen as a type of 'gap', which price will have a tendency to want to re-fill (in part or in full).
-The midline (CE, or 'Consequent encroachment') of FVGs also tend to show price sensitivity.
-This indicator paints all FVGs until priced into, and should give an idea of which are more meaningful and which are best ignored (based on context: location, Time of day, market structure, etc).
-This is a simpler and more efficient method of painting Fair value gaps which auto-stop painting when price reaches them.
//Aims of Publishing:
-Education of ICT concepts of Fair Value Gaps and their midlines (CEs): To easily see via forward testing or backtesting, the sensitivity that price shows to these areas & levels.
-Demonstration of a much more efficient way of plotting FVGs which terminate at price, thanks to a modification of @Bjorgums's clever looping method referenced below.
//Settings:
-Toggle on/off upward and downward FVGs independently(blue and orange by default).
-Toggle on/off midline (CE).
-Standard color/line formatting options.
-Choose Threshold: CE of FVG or Full Fill of FVG: This will determine both the 'stop-painting' trigger and the 'Alert' trigger.
-Choose number of days lookback to control how many historical FVGs paint on chart.
//On alerts:
-Simple choice of 2 alerts:
~~One for price crossing into/above the nearest untouched 'premium' FVG above ( orange ). Trigger is user choice of CE or full fill.
~~Another for price crossing into/below the nearest untouched 'discount' FVG below (blue). Trigger is user choice of CE or full fill.
-Alerts set via the three dots in indicator status line.
//Cautionary notes:
-Do not use the alerts blindly to find trades. Wait until you have identified a good FVG above/below which you think price may show sensitivity to
-Usage on very low timeframes can cause unexpected results with alerts: due to new FVGs forming in realtime the Alert will always trigger at the most recent FVG above/ below having its threshold hit.
-Big thank you to @Bjorgum for his fantastic extendAndRemove method. Modified here for use with boxes and to integrate Alerts.
-Also Credit to ICT (inner circle trader) for the concepts used here: Fair value gaps and their Consequent Encroachment (CE).
ICT MTF FVG [MK]FVGs (Fair Value Gaps) are significant levels that may act as support or resistance to price. The script finds FVGs as per ICT trading system, then plots the full FVG to the right side of the chart. FVG boxes do not change size when they are semi-mitigated as its important to know where the original FVG midpoint lies. Plotting to the right side of price allows for a cleaner chart. The script is MTF and can display FVG boxes for the following timeframes. Chart, 5,10,15,30,1hr,4hr,8hr,12hr,D,W,M.
Below shows 1hr FVGs marked out. NOTE: this is not what the script does, this is for explanation only.
Below shows what the script will do. 1hr FVGs shown on 15min chart