OPEN-SOURCE SCRIPT
Smarter Money Flow Divergence Detector [PhenLabs]

📊 Smarter Money Flow Divergence Detector [PhenLabs]
Version: PineScript™ v6
📌 Description
SMFD was developed to help give you guys a better ability to “read” what is going on behind the scenes without directly having access to that level of data. SMFD is an enhanced divergence detection indicator that identifies money flow patterns from advanced volume analysis and price action correspondence. The detection portion of this indicator combines intelligent money flow calculations with multi timeframe volume analysis to help you see hidden accumulation and distribution phases before major price movements occur.
The indicator measures institutional trading activity by looking at volume surges, price volume dynamics, and the factors of momentum to construct an overall picture of market sentiment. It’s built to assist traders in identifying high probability entries by identifying if smart money is positioning against price action.
🚀 Points of Innovation
● Advanced Smart Money Flow algorithm with volume spike detection and large trade weighting
● Multi timeframe volume analysis for enhanced institutional activity detection
● Dynamic overbought/oversold zones that adapt to current market conditions
● Enhanced divergence detection with pivot confirmation and strength validation
● Color themes with customizable visual styling options
● Real time institutional bias tracking through accumulation/distribution analysis
🔧 Core Components
● Smart Money Flow Calculation: Combines price momentum, volume expansion, and VWAP analysis
● Institutional Bias Oscillator: Tracks accumulation/distribution patterns with volume pressure analysis
● Enhanced Divergence Engine: Detects bullish/bearish divergences with multiple confirmation factors
● Dynamic Zone Detection: Automatically adjusts overbought/oversold levels based on market volatility
● Volume Pressure Analysis: Measures buying vs selling pressure over configurable periods
● Multi factor Signal System: Generates entries with trend alignment and strength validation
🔥 Key Features
● Smart Money Flow Period: Configurable calculation period for institutional activity detection
● Volume Spike Threshold: Adjustable multiplier for detecting unusual institutional volume
● Large Trade Weight: Emphasis factor for high volume periods in flow calculations
● Pivot Detection: Customizable lookback period for accurate divergence identification
● Signal Sensitivity: Three tier system (Conservative/Medium/Aggressive) for signal generation
● Themes: Four color schemes optimized for different chart backgrounds
🎨 Visualization
● Main Oscillator: Line, Area, or Histogram display styles with dynamic color coding
● Institutional Bias Line: Real time tracking of accumulation/distribution phases
● Dynamic Zones: Adaptive overbought/oversold boundaries with gradient fills
● Divergence Lines: Automatic drawing of bullish/bearish divergence connections
● Entry Signals: Clear BUY/SELL labels with signal strength indicators
● Information Panel: Real time statistics and status updates in customizable positions

📖 Usage Guidelines
Algorithm Settings
● Smart Money Flow Period
Higher values provide smoother signals but reduce responsiveness to recent activity
● Volume Spike Threshold

● Large Trade Weight
Divergence Detection
● Pivot Detection Period
Affects divergence accuracy and signal frequency
● Minimum Divergence Strength
Higher values filter out weaker signals
✅ Best Use Cases
● Trading with intraday to daily timeframes for institutional position identification
● Confirming trend reversals when divergences align with support/resistance levels
● Entry timing in trending markets when institutional bias supports the direction
● Risk management by avoiding trades against strong institutional positioning
● Multi timeframe analysis combining short term signals with longer term bias
⚠️ Limitations
● Requires sufficient volume for accurate institutional detection in low volume markets
● Divergence signals may have false positives during highly volatile news events
● Best performance on liquid markets with consistent institutional participation
● Lagging nature of volume based calculations may delay signal generation
● Effectiveness reduced during low participation holiday periods
💡 What Makes This Unique
● Multi Factor Analysis: Combines volume, price, and momentum for comprehensive institutional detection
● Adaptive Zones: Dynamic overbought/oversold levels that adjust to market conditions
● Volume Intelligence: Advanced algorithms identify institutional sized transactions
● Professional Visualization: Multiple display styles with customizable themes
● Confirmation System: Multiple validation layers reduce false signal generation
🔬 How It Works
1. Volume Analysis Phase:
● Analyzes current volume against historical averages to identify institutional activity
● Applies multi timeframe analysis for enhanced detection accuracy
● Calculates volume pressure through buying vs selling momentum
2. Smart Money Flow Calculation:
● Combines typical price with volume weighted analysis
● Applies institutional trade weighting for high volume periods
● Generates directional flow based on price momentum and volume expansion
3. Divergence Detection Process:
● Identifies pivot highs/lows in both price and indicator values
● Validates divergence strength against minimum threshold requirements
● Confirms signals through multiple technical factors before generation
Version: PineScript™ v6
📌 Description
SMFD was developed to help give you guys a better ability to “read” what is going on behind the scenes without directly having access to that level of data. SMFD is an enhanced divergence detection indicator that identifies money flow patterns from advanced volume analysis and price action correspondence. The detection portion of this indicator combines intelligent money flow calculations with multi timeframe volume analysis to help you see hidden accumulation and distribution phases before major price movements occur.
The indicator measures institutional trading activity by looking at volume surges, price volume dynamics, and the factors of momentum to construct an overall picture of market sentiment. It’s built to assist traders in identifying high probability entries by identifying if smart money is positioning against price action.
🚀 Points of Innovation
● Advanced Smart Money Flow algorithm with volume spike detection and large trade weighting
● Multi timeframe volume analysis for enhanced institutional activity detection
● Dynamic overbought/oversold zones that adapt to current market conditions
● Enhanced divergence detection with pivot confirmation and strength validation
● Color themes with customizable visual styling options
● Real time institutional bias tracking through accumulation/distribution analysis
🔧 Core Components
● Smart Money Flow Calculation: Combines price momentum, volume expansion, and VWAP analysis
● Institutional Bias Oscillator: Tracks accumulation/distribution patterns with volume pressure analysis
● Enhanced Divergence Engine: Detects bullish/bearish divergences with multiple confirmation factors
● Dynamic Zone Detection: Automatically adjusts overbought/oversold levels based on market volatility
● Volume Pressure Analysis: Measures buying vs selling pressure over configurable periods
● Multi factor Signal System: Generates entries with trend alignment and strength validation
🔥 Key Features
● Smart Money Flow Period: Configurable calculation period for institutional activity detection
● Volume Spike Threshold: Adjustable multiplier for detecting unusual institutional volume
● Large Trade Weight: Emphasis factor for high volume periods in flow calculations
● Pivot Detection: Customizable lookback period for accurate divergence identification
● Signal Sensitivity: Three tier system (Conservative/Medium/Aggressive) for signal generation
● Themes: Four color schemes optimized for different chart backgrounds
🎨 Visualization
● Main Oscillator: Line, Area, or Histogram display styles with dynamic color coding
● Institutional Bias Line: Real time tracking of accumulation/distribution phases
● Dynamic Zones: Adaptive overbought/oversold boundaries with gradient fills
● Divergence Lines: Automatic drawing of bullish/bearish divergence connections
● Entry Signals: Clear BUY/SELL labels with signal strength indicators
● Information Panel: Real time statistics and status updates in customizable positions
📖 Usage Guidelines
Algorithm Settings
● Smart Money Flow Period
- ○ Default: 20
○ Range: 5-100
○ Description: Controls the calculation period for institutional flow analysis.
Higher values provide smoother signals but reduce responsiveness to recent activity
● Volume Spike Threshold
- ○ Default: 1.8
○ Range: 1.0-5.0
○ Description: Multiplier for detecting unusual volume activity indicating institutional participation.
● Large Trade Weight
- ○ Default: 2.5
○ Range: 1.5-5.0
○ Description: Weight applied to high volume periods in smart money calculations.
Divergence Detection
● Pivot Detection Period
- ○ Default: 12
○ Range: 5-50
○ Description: Bars to analyze for pivot high/low identification.
Affects divergence accuracy and signal frequency
● Minimum Divergence Strength
- ○ Default: 0.25
○ Range: 0.1-1.0
○ Description: Required price change percentage for valid divergence patterns.
Higher values filter out weaker signals
✅ Best Use Cases
● Trading with intraday to daily timeframes for institutional position identification
● Confirming trend reversals when divergences align with support/resistance levels
● Entry timing in trending markets when institutional bias supports the direction
● Risk management by avoiding trades against strong institutional positioning
● Multi timeframe analysis combining short term signals with longer term bias
⚠️ Limitations
● Requires sufficient volume for accurate institutional detection in low volume markets
● Divergence signals may have false positives during highly volatile news events
● Best performance on liquid markets with consistent institutional participation
● Lagging nature of volume based calculations may delay signal generation
● Effectiveness reduced during low participation holiday periods
💡 What Makes This Unique
● Multi Factor Analysis: Combines volume, price, and momentum for comprehensive institutional detection
● Adaptive Zones: Dynamic overbought/oversold levels that adjust to market conditions
● Volume Intelligence: Advanced algorithms identify institutional sized transactions
● Professional Visualization: Multiple display styles with customizable themes
● Confirmation System: Multiple validation layers reduce false signal generation
🔬 How It Works
1. Volume Analysis Phase:
● Analyzes current volume against historical averages to identify institutional activity
● Applies multi timeframe analysis for enhanced detection accuracy
● Calculates volume pressure through buying vs selling momentum
2. Smart Money Flow Calculation:
● Combines typical price with volume weighted analysis
● Applies institutional trade weighting for high volume periods
● Generates directional flow based on price momentum and volume expansion
3. Divergence Detection Process:
● Identifies pivot highs/lows in both price and indicator values
● Validates divergence strength against minimum threshold requirements
● Confirms signals through multiple technical factors before generation
💡 Note: This indicator works best when combined with proper risk management and position sizing. The institutional bias component helps identify market sentiment shifts, while divergence signals provide specific entry opportunities. For optimal results, use on liquid markets with consistent institutional participation and combine with additional technical analysis methods.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Smart Tools for Smarter Trades: phenlabs.com
Join our growing community: discord.gg/phen
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Join our growing community: discord.gg/phen
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Smart Tools for Smarter Trades: phenlabs.com
Join our growing community: discord.gg/phen
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Join our growing community: discord.gg/phen
All content provided by PhenLabs is for informational & educational purposes only. Past performance does not guarantee future results.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.