OPEN-SOURCE SCRIPT
Telah dikemas kini

ICT - Fair Value Gaps (multi timeframe)

1 818
MTF FVG + Volume Imbalance
Overview
This indicator automatically identifies and draws Fair Value Gaps (FVGs) and Volume Imbalances (VIs) across 9 timeframes (1m, 3m, 5m, 15m, 1h, 3h, 4h, 1d, 1w) directly on your TradingView chart, eliminating the need to manually switch timeframes.

Fair Value Gap (FVG)
A 3-candle imbalance where a gap exists between the wick of candle 1 and the wick of candle 3. These zones often act as areas where price may return before continuing in its original direction.

Bullish FVG — low of candle 3 is above high of candle 1
Bearish FVG — high of candle 3 is below low of candle 1

Volume Imbalance (VI)
When a body gap exists between adjacent candles within the FVG pattern, the indicator automatically extends the FVG box to include the imbalance zone, giving a more complete picture of the area of interest.

Mitigation
A box is automatically removed when price closes beyond the gap boundary — keeping your chart clean with only active unmitigated zones visible.

Key Settings
Per Timeframe:

Show/hide toggle
Project to lower timeframes — disabled by default. When enabled, FVGs from that timeframe are visible on all lower timeframe charts. FVGs can never project upward.
Bullish/bearish colour pickers — assign unique colours per timeframe to distinguish zones when multiple timeframes are projected onto the same chart

Lookback Periods — FVGs are restricted to a configurable lookback window to keep the chart focused on recent price action:
GroupTimeframesDefaultIntraday1m, 3m, 5m, 15m5 daysHourly1h, 3h, 4h14 daysDaily1d30 daysWeekly1w140 days
Box Extension — boxes extend to the chart edge by default, updating in real time. Alternatively set a fixed N bar extension in the settings.

For analytical purposes only. Always combine with your own analysis and risk management.
Nota Keluaran
Script updated to exclude NWOGs and NDOGs from FVG logic. This should tidy up the chart.
Nota Keluaran
1. NDOG & NWOG Session Gap Filter

FVGs spanning daily (5pm–6pm ET) and weekly (Fri 5pm–Sun 6pm ET) session gaps are now ignored
Dual filter: session window check on all three candle timestamps + time gap check (4× expected TF duration)

2. New Timeframes

Added 7h, 3D, 1M, 3M, 12M — total now 14 timeframes
New lookback groups: Multi-Day (90d), Monthly (730d), Quarterly (1095d), Annual (1825d)

3. Optimised Settings Menu

Consolidated from 14 individual groups into 7 logical groups
inline= used to place bull/bear colour pickers on the same row, significantly reducing scrolling

4. Show Mitigated FVGs

New toggle (default OFF) at top of settings panel
When ON, mitigated boxes remain visible as outline only (no fill, border width 2)
Active boxes retain original styling (fill + border width 1)
Mitigated boxes respect lookback period
Nota Keluaran
1. Candle-Based Lookback (replaces time-based)

Replaced timenow - days * 86400000 with bar_index-based cutoffs per timeframe
Each timeframe fetches its own current bar_index via request.security() — cutoff = total_bars - lookback_candles
Works identically across all instruments regardless of session schedule, calendar variability, or timezone
Fixes FVGs not displaying on DXY, BTC and other instruments on 3D, 1W, 1M and 12M timeframes

2. Time Gap Check Removed

The (t3 - t1) > expected_ms * 4 check has been removed entirely
Was incorrectly filtering valid FVGs on higher timeframes due to variable month/year lengths
Candle-based lookback now handles scope naturally — the time gap check is no longer needed

3. Session Gap Filter Simplified

is_session_gap() now takes no tf_mins parameter
Window check only applied to intraday timeframes (rank <= 8, up to 7h)
Daily and above are never filtered — they have no intraday session gaps

4. Lookback Defaults Updated

Now expressed in candles rather than days:

GroupDefaultIntraday (1m–15m)500 candlesHourly (1h–7h)500 candlesDaily (1d)365 candlesMulti-Day (3D)200 candlesWeekly (1w)260 candlesMonthly (1M)60 candlesQuarterly (3M)40 candlesAnnual (12M)20 candles
Nota Keluaran
Improved detection logic to filter out NWOG and NDOG
Nota Keluaran
Various updates to add flexibility and improve visuals. Happy to receive any feedback/improvement requests.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.