OPEN-SOURCE SCRIPT
Zaktualizowano

Nested FVG (1min inside 5min)

9 691
Nested FVG — 1min Inside 5min (ICT)
This indicator identifies high-probability Fair Value Gap setups by detecting when a 1-minute FVG forms inside — or within proximity of — a 5-minute FVG of the same direction. This confluence of imbalances across two timeframes is a core concept in ICT methodology, providing a more refined entry within a larger inefficiency.

How It Works
The indicator natively tracks 5-minute candle boundaries directly on the 1-minute chart. When a new 5-minute FVG (BISI or SIBI) forms during the session window, it is stored as an active zone. Every subsequent 1-minute bar is then checked for its own FVG — if that 1-minute gap falls inside or within a configurable proximity of an active 5-minute zone of the same direction, a signal fires.

Signal Logic

Bullish (BISI): 1-min low[0] > high[2], nested inside a 5-min bullish FVG
Bearish (SIBI): 1-min high[0] < low[2], nested inside a 5-min bearish FVG
A 30-bar cooldown prevents signal clusters (configurable)
Both FVGs must meet minimum size thresholds (in basis points) to filter noise


Automatic R/R Overlay
Every signal automatically plots a complete trade plan:

🟡 Entry — midpoint of the 1-min FVG
🔴 Stop — 15 points below/above entry
🔵 Partial — 15 points in profit (1:1)
🟢 Target — 45 points in profit (1:3)
🟨 Extended Target — 60 points in profit (1:4)


Visual Layout

5-min BISI/SIBI zones — solid bordered boxes labeled BISI or SIBI, extend right through the session
1-min nested FVG — dashed bordered boxes, visible for 15 minutes after formation
Triangles — green ▲ below bar for bullish, red ▼ above bar for bearish


Settings

Session filter (default 06:00–16:00 exchange time, works correctly on CME futures)
Minimum FVG size in basis points for both timeframes
Proximity tolerance (how close a 1-min FVG can be to the 5-min zone edge)
Cooldown between signals
All colors, R/R line lengths, and display options fully customizable


Important
► This indicator is designed to run on a 1-minute chart. Results on other timeframes will not be accurate.

For educational purposes only. Not financial advice. Always use proper risk management.
Informacje o Wersji
Updated label placement. Increased time-frame.
Informacje o Wersji
Version 2.0 — Update Notes
New Features:

Position Tracking — The indicator now tracks whether a trade is currently in progress and blocks new signals until the trade is resolved (stop or target hit). This prevents conflicting or overlapping signals on the same chart, which was a common issue when a new nested FVG formed while a previous trade was still open.

Customizable R/R Levels — All risk/reward levels are now user-adjustable inputs under the R/R Tool settings group:
Stop Loss (default: 15 pts)
Partial Target (default: 15 pts)
Main Target (default: 45 pts)
Extended Target (default: 60 pts)

R/R labels on the chart dynamically reflect your custom values. Position tracking also uses your custom stop and target, so the block lifts at the right time for your setup.
Webhook/Automation Ready — Alert messages are now formatted as JSON, making it easy to connect this indicator to automation platforms like TradersPost, Tickerly, or any webhook-compatible service for automated order execution.
Session Update — Default session start updated to 19:00 CT to include the futures overnight open.
All defaults are unchanged — existing users will see identical behavior unless they choose to customize the new inputs.
Informacje o Wersji
Changed the font size on the R/R tool.
Informacje o Wersji
Nested FVG — 1min Inside 5min (ICT) | Auto R/R
This indicator identifies high-probability Fair Value Gap setups by detecting when a 1-minute FVG forms inside — or within proximity of — a 5-minute FVG of the same direction. This confluence of imbalances across two timeframes is a core concept in ICT methodology, providing a more refined entry within a larger inefficiency.

How It Works
The indicator natively tracks 5-minute candle boundaries directly on the 1-minute chart using timeframe.change(), requiring no request.security() calls. When a new 5-minute FVG (BISI or SIBI) forms during the session window, it is stored as an active zone. Every subsequent 1-minute bar is then checked for its own FVG — if that gap falls inside or within a configurable proximity of an active 5-minute zone of the same direction, a signal fires.

Signal Logic

Bullish (BISI): 1-min low[0] > high[2], nested inside a 5-min bullish FVG. Entry at bottom of 1-min FVG (high[2])
Bearish (SIBI): 1-min high[0] < low[2], nested inside a 5-min bearish FVG. Entry at top of 1-min FVG (low[2])
Both FVGs must meet minimum size thresholds (in basis points) to filter noise
A shared + per-direction cooldown prevents signal clusters
Cooldown resets at the start of each new session


Automatic R/R Overlay
Every signal automatically plots a complete trade plan starting on the next candle open after the signal fires:

🟡 Entry — edge of the 1-min FVG (bottom for bull, top for bear)
🔴 Stop — configurable points below/above entry (default 15pts)
🔵 Partial / BE — configurable points in profit (default 15pts)
🟢 Target — configurable points in profit (default 45pts)
🟨 Extended Target — configurable points in profit (default 60pts)

All R/R levels, boxes and labels expire 15 minutes after the signal fires to keep the chart clean.

Visual Layout

5-min BISI zones — solid cyan boxes with "BISI" labeled on both left and right sides inside the box
5-min SIBI zones — solid red boxes with "SIBI" labeled on both left and right sides inside the box
1-min nested FVG — dashed boxes, visible for 15 minutes after formation
▲ / ▼ triangles — green below bar for bullish signals, red above bar for bearish signals
All 5-min zones stretch right through the active session and disappear when mitigated


Settings
5-Minute FVG Settings

Show/hide 5-min zones
Bullish/bearish zone colors
Remove zone when mitigated
Minimum FVG size in basis points (default 0.15bp ≈ 4.5 NQ points)

1-Minute FVG Settings

Show/hide 1-min nested FVG boxes
Bullish/bearish box colors
Minimum FVG size in basis points (default 0.15bp ≈ 4.5 NQ points)

Signal Settings

Bullish/bearish triangle colors
Alert on nested FVG
Cooldown between signals in bars/minutes (default 30)

R/R Tool

Show/hide R/R levels
Stop loss in points (default 15)
Main target in points (default 45)
Partial / BE target in points (default 15)
Extended target in points (default 60)
Stop, entry, target, partial, extended target colors
R/R label text size (tiny → huge)

Proximity Filter

How close a 1-min FVG can be to the 5-min zone edge in basis points (default 5bp)

Time Filter

Session window in exchange time (default 19:00–16:00, works correctly on CME futures including overnight globex)


Important
► This indicator is designed to run on a 1-minute chart. Results on other timeframes will not be accurate.
► Built and tested on NQ/ES CME Futures. Session default is set to Chicago exchange time.

For educational purposes only. Not financial advice. Always use proper risk management.
Informacje o Wersji
What's New in v2
Signal Numbering
Every signal now gets a sequential number (e.g. #251) displayed on the R/R entry label and in the trade tracker table, so you can easily cross-reference signals on the chart with rows in the table.
Automatic R/R Overlay — Improvements

Entry is now based on the edge of the 1-min FVG (bottom for bullish, top for bearish) rather than the midpoint, for a more precise ICT-style entry
All R/R lines and boxes start on the next candle's open after the signal fires
Partial / BE line label updated to clearly read "Partial / BE"
Extended Target added at +60pts (yellow box above the green target box)
R/R Label Size is now adjustable (tiny → huge) in settings
Stop, partial, target, and extended target distances are all individually configurable in points

Trade Tracker Table
A new performance table renders in the corner of your chart showing every signal logged in real time:
Columns: # | Date | Time | Dir | Entry | Stop | Target | Result | P&L
Results auto-detect and update as price moves:

✅ Win — main target hit
❌ Loss — stop hit
🔵 Partial — partial/BE level hit (won't upgrade to Win unless target is subsequently hit)
⏳ Open — trade still active

Summary row at the bottom shows:

📅 TODAY or 📊 ALL mode indicator
Total trades displayed
Win / Loss / Partial counts with emoji icons
Win Rate %
Current streak (🔥 win streak or 🧊 loss streak)
Day P&L in points (resets each session)
All-Time P&L in points
Filtered period P&L in a colored box (green = profitable, red = losing)

Today Only mode — toggle to show only today's trades in the table. Win rate, streak, and P&L in the summary row all reflect today's session only. Date column always visible so you can see which day each trade is from regardless of mode.
New Alerts
Four separate alert conditions, each individually toggleable:

🔔 Nested FVG Signal — entry alert (existing, now with signal number in message)
🔔 Partial / BE Hit — fires when price reaches the partial level
🔔 Stop Hit — fires when stopped out
🔔 Target Hit — fires when main target is reached

Shared Cooldown
Bull and bear cooldowns now share a global timer in addition to their per-direction timers. This means after any signal fires (bull or bear), neither direction can fire again until the cooldown period expires. Prevents cluster signals in fast-moving markets. Cooldown also resets at the start of each new session.
BISI / SIBI Labels
5-min FVG zone labels now appear on both the left and right sides of each box using transparent floating labels that track the right edge as the box stretches through the session.
Table Settings

Table position (6 options)
Table text size (tiny / small / normal)
Max rows to display (3–20)
Today Only toggle
Informacje o Wersji
Added a second table showing most profitable hours.
🔥 Use — dark green — power/afternoon/evening window AND strong P&L (≥300pts, ≥30% WR)
✅ Use — lighter green — recommended window with positive P&L, OR strong performance outside windows
⚠️ Caution — orange — decent P&L but not in a recommended window, keep an eye on it
❌ Cut — red — very low win rate (<15%) or barely profitable despite many signals
Informacje o Wersji
Added a Weekly Tracking Table.
Informacje o Wersji
v2 Update — Weekly Tracker, Hourly Analytics & Theme Options

New: Weekly Performance Table
A new compact table shows your running performance since the current week opened (Sunday 5:00 PM CT — globex open):

Total trades this week
Win / Loss / Partial breakdown
Win Rate %
Points P&L
Dollar P&L (auto-labels your instrument: MNQ, NQ, MES, ES)
"Since Sun 5PM CT" footer so you always know the window

Resets automatically every Sunday at 5PM CT. Position is configurable — defaults to Top Right.
New: Hourly Performance Table
A separate table breaks down every signal by hour of the day showing wins, losses, win rate, P&L, and an automatic rating:

** USE ** — strongest hours, recommended for trading
* Use * — solid performing hours
! Caution — proceed carefully, mixed results
X Cut X — underperforming hours to avoid

Use this to identify your best trading windows over time.
New: Dark / Light Theme
A new "Table Theme" toggle in Trade Tracker settings switches all three tables between:

Dark — deep navy headers, dark rows, white text (default, great for dark charts)
Light — soft lavender headers, white rows, dark navy text (great for light charts)

Entry prices automatically switch from yellow (dark) to deep orange (light) for better readability.
New: $ Per Point Setting
Configure the dollar value per point for your instrument so the Weekly table shows accurate dollar P&L:

MNQ = $2.00
MES = $5.00
NQ = $20.00
ES = $50.00

New: Signal Numbering
Every signal now gets a sequential number displayed on the R/R entry label (e.g. #233 E @ 30075.25) so you can cross-reference signals on the chart with rows in the trade tracker table.
New: T2 Label
The extended target label has been renamed from "E2" to "T2" (Target 2) for clarity.
Existing Features
All original features remain unchanged — BISI/SIBI zones, 1-min nested FVG detection, R/R overlay with Partial/BE, Stop, Target, and Extended Target levels, trade tracker table with Today Only mode, session filter, cooldown, proximity filter, and all alerts.
Informacje o Wersji
Updated the Weekly Tracker to track by day.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.