OPEN-SOURCE SCRIPT

Smarter Money Concepts - FVGs [PhenLabs]

3 047
📊 Smarter Money Concepts - FVGs [PhenLabs]
Version: PineScript™ v6

📌 Description
Smarter Money Concepts - FVGs is a sophisticated indicator designed to identify and track Fair Value Gaps (FVGs) in price action. These gaps represent market inefficiencies where price moves quickly, creating imbalances that often attract subsequent price action for mitigation. By highlighting these key areas, traders can identify potential zones for reversals, continuations, and price targets.

The indicator employs volume filtering ideology to highlight only the most significant FVGs, reducing noise and focusing on gaps formed during periods of higher relative volume. This combination of price structure analysis and volume confirmation provides traders with high-probability areas of interest that institutional smart money may target during future price movements.

🚀 Points of Innovation
  • Volume-Filtered Gap Detection: Eliminates low-significance FVGs by requiring a minimum volume threshold, focusing only on gaps formed with institutional participation
  • Equilibrium Line Visualization: Displays the midpoint of each gap as a potential precision target for trades
  • Automated Gap Mitigation Tracking: Monitors when price revisits and mitigates gaps, automatically managing visual elements
  • Time-Based Gap Management: Intelligently filters gaps based on a configurable timeframe, maintaining chart clarity
  • Dual Direction Analysis: Simultaneously tracks both bullish and bearish gaps, providing a complete market structure view
  • Memory-Optimized Design: Implements efficient memory management for smooth chart performance even with numerous FVGs


🔧 Core Components
Fair Value Gap Detection: Identifies price inefficiencies where the current candle’s low is higher than the previous candle’s high (bearish FVG) or where the current candle’s high is lower than the previous candle’s low (bullish FVG).

Volume Filtering Mechanism: Calculates relative volume compared to a moving average to qualify only gaps formed during significant market activity.

Mitigation Tracking: Continuously monitors price action to detect when gaps get filled, with options to either hide or maintain visual representation of mitigated gaps.

🔥 Key Features
  • Customizable Gap Display: Toggle visibility of bullish and bearish gaps independently to focus on your preferred market direction
  • Volume Threshold Control: Adjust the minimum volume ratio required for gap qualification, allowing fine-tuning between sensitivity and significance
  • Flexible Mitigation Methods: Choose between “Wick” or “Close” methods for determining when a gap has been mitigated, adapting to different trading styles
  • Visual Customization: Full control over colors, transparency, and style of gap boxes and equilibrium lines


🎨 Visualization
Gap Boxes: Rectangular highlights showing the exact price range of each Fair Value Gap. Bullish gaps indicate potential upward price targets, while bearish gaps show potential downward targets.

Equilibrium Lines: Dotted lines running through the center of each gap, representing the mathematical midpoint that often serves as a precision target for price movement.

📖 Usage Guidelines
General Settings
  • Days to Analyze: Default: 15, Range: 1-100. Controls how many days of historical gaps to display, balancing between comprehensive analysis and chart clarity


Visual Settings
  • Bull Color: Default:(#596fd33f). Color for bullish Fair Value Gaps, typically using high transparency for clear chart visibility
  • Bear Color: Default:(#d3454575). Color for bearish Fair Value Gaps, typically using high transparency for clear chart visibility
  • Equilibrium Line: Default: Enabled. Toggles visibility of the center equilibrium line for each FVG
  • Eq. Line Color: Default: Black with 99% transparency. Sets the color of equilibrium lines, usually kept subtle to avoid chart clutter
  • Eq. Line Style: Default: Dotted, Options: Dotted, Solid, Dashed. Determines the line style for equilibrium lines


Mitigation Settings
  • Mitigation Method: Default: Wick, Options: Wick, Close. Determines how gap mitigation is calculated - “Wick” uses high/low values while “Close” uses open/close values for more conservative mitigation criteria
  • Hide Mitigated: Default: Enabled. When enabled, gaps become transparent once mitigated, reducing visual clutter while maintaining historical context


Volume Filter
  • Volume Filter: Default: Enabled. When enabled, only shows gaps formed with significant volume relative to recent average
  • Min Ratio: Default: 1.5, Range: 0.1-10.0. Minimum volume ratio compared to average required to display an FVG; higher values filter out more gaps
  • Periods: Default: 15, Range: 5-50. Number of periods used to calculate the average volume baseline


✅ Best Use Cases
  • Identifying potential reversal zones where price may react after extended moves
  • Finding precise targets for take-profit placement in trend-following strategies
  • Detecting institutional interest areas for potential breakout or breakdown confirmations
  • Plotting significant support and resistance zones based on structural imbalances
  • Developing fade strategies at key market structure points
  • Confirming trade entries when price approaches significant unfilled gaps


⚠️ Limitations
  • Works best on higher timeframes where gaps reflect more significant market inefficiencies
  • Very choppy or ranging markets may produce small gaps with limited predictive value
  • Volume filtering depends on accurate volume data, which may be less reliable for some symbols
  • Performance may be affected when displaying a very large number of historical gaps
  • Some gaps may never be fully mitigated, particularly in strongly trending markets


💡 What Makes This Unique
Volume Intelligence: Unlike basic FVG indicators, this script incorporates volume analysis to identify the most significant structural imbalances, focusing on quality over quantity.

Visual Clarity Management: Automatic handling of mitigated gaps and memory management ensures your chart remains clean and informative even over extended analysis periods.

Dual-Direction Comprehensive Analysis: Simultaneously tracks both bullish and bearish gaps, providing a complete market structure picture rather than forcing a directional bias.

🔬 How It Works
1. Gap Detection Process:
The indicator examines each candle in relation to previous candles, identifying when a gap forms between the low of candle[3] and high of candle[1] (bearish FVG) or between the high of candle[3] and low of candle[1] (bullish FVG). This specific candle relationship identifies true structural imbalances.

2. Volume Qualification:
For each potential gap, the algorithm calculates the relative volume compared to the configured period average. Only gaps formed with volume exceeding the minimum ratio threshold are displayed, ensuring focus on institutionally significant imbalances.

3. Equilibrium Calculation:
For each qualified gap, the script calculates the precise mathematical midpoint, which becomes the equilibrium line - a key target that price often gravitates toward during mitigation attempts.

4. Mitigation Tracking:
The indicator continuously monitors price action against existing gaps, determining mitigation based on the selected method (wick or close). When price reaches the equilibrium point, the gap is considered mitigated and can be visually updated accordingly.


💡 Note:
Fair Value Gaps represent market inefficiencies that often, but not always, get filled. Use this indicator as part of a complete trading strategy rather than as a standalone system. The most valuable signals typically come from combining FVG analysis with other confirmatory indicators and overall market context. For optimal results, start with the default settings and gradually adjust parameters to match your specific trading timeframe and style.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.