OPEN-SOURCE SCRIPT
Advanced FVG Detector Pro

📊 Advanced FVG Detector Pro - Smart Money Analysis Tool
Overview
The Advanced FVG Detector Pro is a sophisticated Pine Script v6 indicator designed to identify and track Fair Value Gaps (FVGs) with institutional-grade precision. This tool goes beyond basic gap detection by incorporating volume analysis, smart money scoring, and adaptive filtering to help traders identify high-probability trading opportunities.
What are Fair Value Gaps?
Fair Value Gaps (FVGs) are price inefficiencies that occur when the market moves so quickly that it leaves behind an imbalance or "gap" in price action. These gaps often act as magnets for future price movement as the market seeks to fill these inefficiencies. Professional traders and institutions closely monitor FVGs as they represent areas of potential support, resistance, and high-probability trade setups.
🎯 Key Features
1. Smart Money Scoring System
Proprietary algorithm that rates each FVG on a 0-100 scale Combines gap size, volume strength, price location, and trend alignment Filter out low-quality setups by setting minimum score thresholdsFocus on institutional-grade opportunities with scores above 70
2. Advanced Volume Validation
Validates FVGs with volume analysis to reduce false signals Only displays gaps formed during significant volume periods Customizable volume multiplier for different market conditions
Visual volume strength indicators on chart
3. Flexible Mitigation Options
Full Fill: Traditional complete gap closure Midpoint Touch: More aggressive entry strategy
Partial Fill: Customizable percentage-based mitigation (10-90%) Choose the strategy that matches your trading style
4. ATR-Based Adaptive Filtering
Automatically adjusts to market volatility using Average True Range Works consistently across any instrument, timeframe, or volatility regime No manual recalibration needed when switching markets Filters out noise while capturing meaningful gaps
5. Real-Time Statistics Dashboard
Live tracking of total active FVGs Bullish vs Bearish gap count Mitigation rate percentage
Average Smart Money Score Toggle on/off based on preference
6. Professional Visual Design
Clean, customizable color schemes Optional midline display for precise entry planning
Labels showing gap type, score, and volume strength Automatic extension of active gaps
Mitigated gaps change color for easy identification
📈 How to Use
For Day Traders:
Use 1H-4H timeframes
For Position Traders:
🔧 Customization Options
Detection Settings:
Minimum FVG size percentage filter
ATR-based size filtering
Maximum number of gaps to display
Smart Money Score minimum threshold
Volume Analysis:
Volume validation toggle
Volume multiplier adjustment
Volume moving average period
Visual volume strength background
Mitigation Control:
Choose mitigation type (Full/Midpoint/Partial)
Set partial fill percentage
Auto-remove mitigated gaps
Control how long mitigated gaps remain visible
Visual Customization:
Bullish/Bearish/Mitigated colors
Show/hide midlines
Show/hide labels
Box extension length
Statistics dashboard toggle
🎓 Trading Strategy Ideas
1. FVG Retest Strategy
Wait for price to create a high-score FVG (70+)
Enter on the first retest of the gap
Place stop loss beyond the gap
Target the opposite side of the gap or next FVG
2. Confluence Trading
Combine FVGs with support/resistance levels
Look for FVGs near key moving averages (20/50 EMA)
Higher probability when FVG aligns with trendlines
Use multiple timeframe analysis
3. Breakout Confirmation
FVGs often form during strong breakouts
High-volume FVGs confirm breakout strength
Enter on mitigation of breakout FVG
Trail stops as new FVGs form in trend direction
⚡ Performance Optimizations
Efficient memory management for smooth chart performance
Optimized calculations run only once per bar
Smart array management prevents memory leaks
Works smoothly even with 100+ active FVGs
🔔 Alert System
Customizable alerts for new bullish FVGs
Customizable alerts for new bearish FVGs
Mitigation alerts for active gaps
Frequency control to avoid alert spam
💡 Pro Tips
Multi-Timeframe Approach: Identify major FVGs on higher timeframes (Daily/4H) and use lower timeframes (15M/5M) for precise entries
Volume Confirmation: The highest probability setups occur when FVGs form with 2x+ average volume
Trend Alignment: Trade FVGs in the direction of the major trend for best results
Patience Pays: Wait for price to return to the FVG rather than chasing breakouts
Risk Management: Always use stop losses beyond the FVG boundaries
📚 Educational Value
This indicator is perfect for:
Learning to identify institutional order flow
Understanding market microstructure
Developing price action trading skills
Recognizing supply and demand imbalances
Improving entry and exit timing
⚠️ Disclaimer
This indicator is a tool for technical analysis and should not be used as the sole basis for trading decisions. Always combine with proper risk management, fundamental analysis, and your own trading plan. Past performance does not guarantee future results.
🔄 Updates & Support
Regular updates will include:
Additional filtering options
Enhanced multi-timeframe analysis
More customization features
Performance improvements
📊 Best Pairs/Markets
Works excellently on:
Forex pairs (EUR/USD, GBP/USD, etc.)
Cryptocurrency (BTC, ETH, etc.)
Stock indices (SPX, NQ, etc.)
Individual stocks
Commodities (Gold, Oil, etc.)
Version Information
Version: 1.0
Pine Script: Version 6
Type: Overlay Indicator
Max Boxes: 500
Max Lines: 500
Overview
The Advanced FVG Detector Pro is a sophisticated Pine Script v6 indicator designed to identify and track Fair Value Gaps (FVGs) with institutional-grade precision. This tool goes beyond basic gap detection by incorporating volume analysis, smart money scoring, and adaptive filtering to help traders identify high-probability trading opportunities.
What are Fair Value Gaps?
Fair Value Gaps (FVGs) are price inefficiencies that occur when the market moves so quickly that it leaves behind an imbalance or "gap" in price action. These gaps often act as magnets for future price movement as the market seeks to fill these inefficiencies. Professional traders and institutions closely monitor FVGs as they represent areas of potential support, resistance, and high-probability trade setups.
🎯 Key Features
1. Smart Money Scoring System
Proprietary algorithm that rates each FVG on a 0-100 scale Combines gap size, volume strength, price location, and trend alignment Filter out low-quality setups by setting minimum score thresholdsFocus on institutional-grade opportunities with scores above 70
2. Advanced Volume Validation
Validates FVGs with volume analysis to reduce false signals Only displays gaps formed during significant volume periods Customizable volume multiplier for different market conditions
Visual volume strength indicators on chart
3. Flexible Mitigation Options
Full Fill: Traditional complete gap closure Midpoint Touch: More aggressive entry strategy
Partial Fill: Customizable percentage-based mitigation (10-90%) Choose the strategy that matches your trading style
4. ATR-Based Adaptive Filtering
Automatically adjusts to market volatility using Average True Range Works consistently across any instrument, timeframe, or volatility regime No manual recalibration needed when switching markets Filters out noise while capturing meaningful gaps
5. Real-Time Statistics Dashboard
Live tracking of total active FVGs Bullish vs Bearish gap count Mitigation rate percentage
Average Smart Money Score Toggle on/off based on preference
6. Professional Visual Design
Clean, customizable color schemes Optional midline display for precise entry planning
Labels showing gap type, score, and volume strength Automatic extension of active gaps
Mitigated gaps change color for easy identification
📈 How to Use
For Day Traders:
- Use 5-15 minute timeframes
- Set ATR Multiplier to 0.15-0.25
- Enable volume validation
- Focus on FVGs with scores above 65
- For Swing Traders:
Use 1H-4H timeframes
- Set ATR Multiplier to 0.5-1.0
- Use "Midpoint Touch" mitigation
- Focus on FVGs with scores above 70
For Position Traders:
- Use Daily timeframe
- Set ATR Multiplier to 0.75-1.5
- Use "Full Fill" mitigation
- Focus on FVGs with scores above 75
🔧 Customization Options
Detection Settings:
Minimum FVG size percentage filter
ATR-based size filtering
Maximum number of gaps to display
Smart Money Score minimum threshold
Volume Analysis:
Volume validation toggle
Volume multiplier adjustment
Volume moving average period
Visual volume strength background
Mitigation Control:
Choose mitigation type (Full/Midpoint/Partial)
Set partial fill percentage
Auto-remove mitigated gaps
Control how long mitigated gaps remain visible
Visual Customization:
Bullish/Bearish/Mitigated colors
Show/hide midlines
Show/hide labels
Box extension length
Statistics dashboard toggle
🎓 Trading Strategy Ideas
1. FVG Retest Strategy
Wait for price to create a high-score FVG (70+)
Enter on the first retest of the gap
Place stop loss beyond the gap
Target the opposite side of the gap or next FVG
2. Confluence Trading
Combine FVGs with support/resistance levels
Look for FVGs near key moving averages (20/50 EMA)
Higher probability when FVG aligns with trendlines
Use multiple timeframe analysis
3. Breakout Confirmation
FVGs often form during strong breakouts
High-volume FVGs confirm breakout strength
Enter on mitigation of breakout FVG
Trail stops as new FVGs form in trend direction
⚡ Performance Optimizations
Efficient memory management for smooth chart performance
Optimized calculations run only once per bar
Smart array management prevents memory leaks
Works smoothly even with 100+ active FVGs
🔔 Alert System
Customizable alerts for new bullish FVGs
Customizable alerts for new bearish FVGs
Mitigation alerts for active gaps
Frequency control to avoid alert spam
💡 Pro Tips
Multi-Timeframe Approach: Identify major FVGs on higher timeframes (Daily/4H) and use lower timeframes (15M/5M) for precise entries
Volume Confirmation: The highest probability setups occur when FVGs form with 2x+ average volume
Trend Alignment: Trade FVGs in the direction of the major trend for best results
Patience Pays: Wait for price to return to the FVG rather than chasing breakouts
Risk Management: Always use stop losses beyond the FVG boundaries
📚 Educational Value
This indicator is perfect for:
Learning to identify institutional order flow
Understanding market microstructure
Developing price action trading skills
Recognizing supply and demand imbalances
Improving entry and exit timing
⚠️ Disclaimer
This indicator is a tool for technical analysis and should not be used as the sole basis for trading decisions. Always combine with proper risk management, fundamental analysis, and your own trading plan. Past performance does not guarantee future results.
🔄 Updates & Support
Regular updates will include:
Additional filtering options
Enhanced multi-timeframe analysis
More customization features
Performance improvements
📊 Best Pairs/Markets
Works excellently on:
Forex pairs (EUR/USD, GBP/USD, etc.)
Cryptocurrency (BTC, ETH, etc.)
Stock indices (SPX, NQ, etc.)
Individual stocks
Commodities (Gold, Oil, etc.)
Version Information
Version: 1.0
Pine Script: Version 6
Type: Overlay Indicator
Max Boxes: 500
Max Lines: 500
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。