OPEN-SOURCE SCRIPT
Multi-Timeframe Fair Value Gap by Vigna

📊 Multi-Timeframe Fair Value Gap (FVG) Indicator
This indicator displays Fair Value Gaps (FVGs) from multiple timeframes simultaneously on your chart. FVGs are price gaps that occur when the market moves quickly and skips certain price levels. These gaps tend to be "filled" later and often serve as important support and resistance zones.
🎯 What are Fair Value Gaps?
A Fair Value Gap occurs when:
Bullish FVG: The current low is higher than the high from 2 candles ago (gap upward)
Bearish FVG: The current high is lower than the low from 2 candles ago (gap downward)
⏱️ Supported Timeframes:
1 Hour (1H)
2 Hours (2H)
3 Hours (3H)
4 Hours (4H)
1 Day (1D)
1 Week (1W)
🎨 Features:
✅ All timeframes visible simultaneously
✅ Each timeframe has its own color (bullish & bearish)
✅ Labels show the timeframe of each gap
✅ Automatic deletion when gap is filled
✅ Optional: MidPoint Fill (gap marked as filled at 50%)
✅ Extend right: Gaps extend to the right until filled
✅ All colors fully customizable
⚙️ Settings:
Timeframes: Enable/disable individual timeframes as needed
MidPoint Fill: Mark gap as filled when 50% is reached
Delete On Fill: Automatically remove filled gaps from chart
Label Timeframes: Show labels with timeframe names
Colors: Customize all colors to your preferences
💡 Application:
FVGs often serve as magnetic attraction points for price
Higher timeframe FVGs (4H, 1D, 1W) are typically more significant
Use FVGs as potential entry/exit zones
Combine with other indicators for better confirmation
📈 Recommended Use:
Works best on timeframes from 15min to 1H
Ideal for Forex, Crypto, and Stocks
Especially useful for Swing Trading and Day Trading
🔧 Technical Details:
Uses optimized request.security() calls (12 total, under the 40 limit)
Employs tuple syntax for efficient data fetching
Real-time gap detection and filling mechanism
Memory-efficient array management with var keyword
This indicator displays Fair Value Gaps (FVGs) from multiple timeframes simultaneously on your chart. FVGs are price gaps that occur when the market moves quickly and skips certain price levels. These gaps tend to be "filled" later and often serve as important support and resistance zones.
🎯 What are Fair Value Gaps?
A Fair Value Gap occurs when:
Bullish FVG: The current low is higher than the high from 2 candles ago (gap upward)
Bearish FVG: The current high is lower than the low from 2 candles ago (gap downward)
⏱️ Supported Timeframes:
1 Hour (1H)
2 Hours (2H)
3 Hours (3H)
4 Hours (4H)
1 Day (1D)
1 Week (1W)
🎨 Features:
✅ All timeframes visible simultaneously
✅ Each timeframe has its own color (bullish & bearish)
✅ Labels show the timeframe of each gap
✅ Automatic deletion when gap is filled
✅ Optional: MidPoint Fill (gap marked as filled at 50%)
✅ Extend right: Gaps extend to the right until filled
✅ All colors fully customizable
⚙️ Settings:
Timeframes: Enable/disable individual timeframes as needed
MidPoint Fill: Mark gap as filled when 50% is reached
Delete On Fill: Automatically remove filled gaps from chart
Label Timeframes: Show labels with timeframe names
Colors: Customize all colors to your preferences
💡 Application:
FVGs often serve as magnetic attraction points for price
Higher timeframe FVGs (4H, 1D, 1W) are typically more significant
Use FVGs as potential entry/exit zones
Combine with other indicators for better confirmation
📈 Recommended Use:
Works best on timeframes from 15min to 1H
Ideal for Forex, Crypto, and Stocks
Especially useful for Swing Trading and Day Trading
🔧 Technical Details:
Uses optimized request.security() calls (12 total, under the 40 limit)
Employs tuple syntax for efficient data fetching
Real-time gap detection and filling mechanism
Memory-efficient array management with var keyword
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.