OPEN-SOURCE SCRIPT

Multi-Timeframe Fair Value Gap by Vigna

105
📊 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

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.