PROTECTED SOURCE SCRIPT
AlphaFlow - Trend Detector

OVERVIEW
AlphaFlow identifies and tracks large volume moves by combining volume analysis, price impact measurement, and conviction scoring to separate significant institutional moves from normal trading activity. Rather than just flagging high volume, this indicator evaluates whether large trades actually moved the market and assigns conviction levels based on multiple confirmation factors.
WHAT MAKES THIS ORIGINAL
This is not simply a volume indicator or volume-weighted price tracker. The originality lies in the multi-factor conviction scoring system that evaluates whether large volume moves represent genuine institutional conviction or just noise.
Key Differentiators:
- Combines volume ratio AND price impact (volume alone doesn't mean conviction)
- Conviction scoring system that weighs trend alignment, follow-through, and volume persistence
- Cumulative flow tracking that shows persistent directional pressure over time
- Market regime detection (bullish/bearish/sideways) based on flow dynamics
- Tiered signal system (EXTREME/HIGH/MEDIUM conviction) rather than binary signals
This approach solves the problem of volume spikes that don't lead to meaningful price action, or price moves on low volume that don't persist.
HOW IT WORKS
1. Whale Detection Engine:
Volume Qualification: Compares current volume to a rolling average (default 50 bars). Whale activity requires volume to be at least 1.5x the average (adjustable).
Price Impact Requirement: Volume alone isn't enough. The bar must also show significant price movement (default 0.1% minimum). This filters out high-volume consolidation where no one is actually committed to direction.
Direction Identification: Bullish whale = close > open on high volume. Bearish whale = close < open on high volume.
2. Conviction Scoring System:
The indicator doesn't just flag whale activity - it evaluates conviction through multiple factors:
Base Conviction: Calculated from (volume_ratio × price_impact) / 10
This gives higher scores to moves with both exceptional volume AND large price swings.
Trend Alignment Bonus (1.5x multiplier): Whale moves aligned with the 20-period EMA trend receive higher conviction scores. Institutional money tends to accumulate with the trend, not against it.
Follow-Through Bonus (1.3x multiplier): After whale activity, does price continue in that direction over the next bars (default 3)? Genuine conviction shows persistence.
Volume Persistence (1.2x multiplier): Is elevated volume sustained over multiple bars, or is it a one-time spike? The 3-bar average volume ratio above 1.5x indicates sustained interest.
Conviction Levels:
- EXTREME: Score > 15 (large whale emoji labels, highest confidence)
- HIGH: Score > 8 (triangle signals, strong confidence)
- MEDIUM: Score > 3 (small triangles, moderate confidence)
- LOW: Score < 3 (not plotted to reduce noise)
3. Cumulative Flow Analysis:
Rather than treating each whale move in isolation, the indicator tracks cumulative flow using an EMA of whale activity. This reveals persistent directional pressure.
Flow Calculation: Each whale bar contributes (whale_strength × direction) to the flow. Strength is volume_ratio × price_impact_percent.
Flow Momentum: Rate of change in the cumulative flow (5-bar change)
Flow Acceleration: Second derivative (3-bar change of momentum)
These metrics reveal whether whale activity is accelerating, decelerating, or reversing.
4. Market Regime Detection:
Bullish Regime: Cumulative flow > 2 AND momentum positive
Bearish Regime: Cumulative flow < -2 AND momentum negative
Sideways Regime: Neither condition met
The background color reflects the current regime, helping traders understand the broader context.
5. Flow Strength Meter:
The main plot normalizes cumulative flow to a -100 to +100 scale based on the 100-bar range. This provides a consistent visual reference regardless of the asset or timeframe.
Extreme levels at ±50 indicate particularly strong directional flow where reversals or consolidation become more likely.
HOW TO USE IT
Settings Configuration:
Whale Detection Section:
- Volume Average Period (default 50): Shorter periods make detection more sensitive to recent volume changes. Longer periods require more exceptional volume to trigger.
- Whale Volume Multiplier (default 1.5): How much above average volume must be to qualify. Lower = more signals. Higher = only extreme moves.
- Minimum Price Impact (default 0.1%): Filters out high-volume bars that didn't actually move price. Adjust based on asset volatility.
Trend Analysis:
- Trend Strength Period (default 20): EMA period for trend alignment bonus
- Confirmation Bars (default 3): How many bars to check for follow-through
Visual Settings:
- Flow Strength Meter: Main plot showing normalized cumulative flow
- Conviction Labels: Detailed labels showing volume ratio and price impact on extreme/high conviction whales
- Trend Background: Color-coded regime indication
Signal Interpretation:
EXTREME Conviction (Whale Emoji Labels):
These are the highest confidence signals. Large volume with significant price impact, aligned with trend, showing follow-through. These often mark the beginning or continuation of strong moves.
HIGH Conviction (Large Triangles):
Strong signals meeting most criteria. Good for main entries or adding to positions.
MEDIUM Conviction (Small Triangles):
Whale activity present but with fewer confirmation factors. Use for partial positions or require additional confirmation.
Flow Strength Meter:
- Above zero and rising: Bullish flow building
- Below zero and falling: Bearish flow building
- Approaching ±50: Extreme readings, watch for exhaustion
- Crossing zero: Flow regime change
Dashboard Information:
The top-right table shows:
- Current regime (bullish/bearish/sideways)
- Flow strength value
- Last whale direction
- Conviction level of last whale
- Current volume ratio
- Flow momentum direction
- Indicator status
Trading Strategies:
Trend Following: Take EXTREME and HIGH conviction signals aligned with the flow meter direction. Enter when flow is positive and rising for bullish whales, negative and falling for bearish whales.
Regime-Based: Only trade in bullish/bearish regimes (colored backgrounds). Avoid trading in sideways regimes where whale moves tend to reverse quickly.
Flow Reversals: When flow meter crosses zero with EXTREME conviction whale in the new direction, this often marks regime changes.
Exhaustion Plays: When flow reaches ±50 extreme levels, watch for EXTREME conviction whales in the opposite direction as potential reversal signals.
TECHNICAL DETAILS
Volume Ratio = Current Volume / SMA(Volume, Period)
Price Impact % = ABS(Close - Open) / Open × 100
Whale Detected = (Volume Ratio >= Multiplier) AND (Price Impact >= Minimum)
Whale Direction = Close > Open ? 1 : -1
Base Conviction = (Volume Ratio × Price Impact %) / 10
Trend Alignment = Whale Direction == Trend Direction ? 1.5 : 1.0
Follow-Through = Price continues whale direction over N bars ? 1.3 : 1.0
Volume Persistence = SMA(Volume Ratio, 3) > 1.5 ? 1.2 : 1.0
Final Conviction = Base × Trend Alignment × Follow-Through × Volume Persistence
Whale Flow = Whale Detected ? (Volume Ratio × Price Impact × Direction) : 0
Cumulative Flow = EMA(Whale Flow, 20)
Flow Momentum = Change(Cumulative Flow, 5)
Flow Acceleration = Change(Momentum, 3)
Normalized Flow Strength = (Cumulative Flow / Highest(ABS(Cumulative Flow), 100)) × 100
WHAT THIS SOLVES
Common Volume Indicator Problems:
- Volume spikes that don't move price (consolidation noise)
- Price moves on low volume that quickly reverse
- No differentiation between strong and weak volume signals
- Treating all high-volume bars equally regardless of context
- No measure of whether volume represents conviction or panic
Whale Flow Solutions:
- Requires both volume AND price impact for signals
- Conviction scoring separates strong moves from weak ones
- Cumulative flow shows persistent pressure vs isolated spikes
- Trend alignment and follow-through filter low-quality signals
- Tiered system lets traders choose their confidence threshold
LIMITATIONS
- Cannot identify individual whales or attribute volume to specific entities
- High volume can come from many sources (whales, retail panic, algo activity)
- Works best on liquid assets with consistent volume patterns
- Less reliable on low-volume assets or during market closures
- Conviction scoring thresholds may need adjustment per asset/timeframe
- Does not predict future whale activity, only identifies it after bars close
- Flow can remain at extremes longer than expected during strong trends
- False signals can occur during news events or earnings
- Not a standalone trading system - requires risk management and other analysis
Best used in combination with price action, support/resistance, and broader market context.
EDUCATIONAL VALUE
For traders learning about:
- Volume analysis beyond simple volume indicators
- Multi-factor signal confirmation systems
- Market regime and flow concepts
- Conviction-based scoring methodologies
- Cumulative indicator design
- Normalized plotting for cross-asset comparison
- Pine Script table and dashboard creation
Not financial advice.
AlphaFlow identifies and tracks large volume moves by combining volume analysis, price impact measurement, and conviction scoring to separate significant institutional moves from normal trading activity. Rather than just flagging high volume, this indicator evaluates whether large trades actually moved the market and assigns conviction levels based on multiple confirmation factors.
WHAT MAKES THIS ORIGINAL
This is not simply a volume indicator or volume-weighted price tracker. The originality lies in the multi-factor conviction scoring system that evaluates whether large volume moves represent genuine institutional conviction or just noise.
Key Differentiators:
- Combines volume ratio AND price impact (volume alone doesn't mean conviction)
- Conviction scoring system that weighs trend alignment, follow-through, and volume persistence
- Cumulative flow tracking that shows persistent directional pressure over time
- Market regime detection (bullish/bearish/sideways) based on flow dynamics
- Tiered signal system (EXTREME/HIGH/MEDIUM conviction) rather than binary signals
This approach solves the problem of volume spikes that don't lead to meaningful price action, or price moves on low volume that don't persist.
HOW IT WORKS
1. Whale Detection Engine:
Volume Qualification: Compares current volume to a rolling average (default 50 bars). Whale activity requires volume to be at least 1.5x the average (adjustable).
Price Impact Requirement: Volume alone isn't enough. The bar must also show significant price movement (default 0.1% minimum). This filters out high-volume consolidation where no one is actually committed to direction.
Direction Identification: Bullish whale = close > open on high volume. Bearish whale = close < open on high volume.
2. Conviction Scoring System:
The indicator doesn't just flag whale activity - it evaluates conviction through multiple factors:
Base Conviction: Calculated from (volume_ratio × price_impact) / 10
This gives higher scores to moves with both exceptional volume AND large price swings.
Trend Alignment Bonus (1.5x multiplier): Whale moves aligned with the 20-period EMA trend receive higher conviction scores. Institutional money tends to accumulate with the trend, not against it.
Follow-Through Bonus (1.3x multiplier): After whale activity, does price continue in that direction over the next bars (default 3)? Genuine conviction shows persistence.
Volume Persistence (1.2x multiplier): Is elevated volume sustained over multiple bars, or is it a one-time spike? The 3-bar average volume ratio above 1.5x indicates sustained interest.
Conviction Levels:
- EXTREME: Score > 15 (large whale emoji labels, highest confidence)
- HIGH: Score > 8 (triangle signals, strong confidence)
- MEDIUM: Score > 3 (small triangles, moderate confidence)
- LOW: Score < 3 (not plotted to reduce noise)
3. Cumulative Flow Analysis:
Rather than treating each whale move in isolation, the indicator tracks cumulative flow using an EMA of whale activity. This reveals persistent directional pressure.
Flow Calculation: Each whale bar contributes (whale_strength × direction) to the flow. Strength is volume_ratio × price_impact_percent.
Flow Momentum: Rate of change in the cumulative flow (5-bar change)
Flow Acceleration: Second derivative (3-bar change of momentum)
These metrics reveal whether whale activity is accelerating, decelerating, or reversing.
4. Market Regime Detection:
Bullish Regime: Cumulative flow > 2 AND momentum positive
Bearish Regime: Cumulative flow < -2 AND momentum negative
Sideways Regime: Neither condition met
The background color reflects the current regime, helping traders understand the broader context.
5. Flow Strength Meter:
The main plot normalizes cumulative flow to a -100 to +100 scale based on the 100-bar range. This provides a consistent visual reference regardless of the asset or timeframe.
Extreme levels at ±50 indicate particularly strong directional flow where reversals or consolidation become more likely.
HOW TO USE IT
Settings Configuration:
Whale Detection Section:
- Volume Average Period (default 50): Shorter periods make detection more sensitive to recent volume changes. Longer periods require more exceptional volume to trigger.
- Whale Volume Multiplier (default 1.5): How much above average volume must be to qualify. Lower = more signals. Higher = only extreme moves.
- Minimum Price Impact (default 0.1%): Filters out high-volume bars that didn't actually move price. Adjust based on asset volatility.
Trend Analysis:
- Trend Strength Period (default 20): EMA period for trend alignment bonus
- Confirmation Bars (default 3): How many bars to check for follow-through
Visual Settings:
- Flow Strength Meter: Main plot showing normalized cumulative flow
- Conviction Labels: Detailed labels showing volume ratio and price impact on extreme/high conviction whales
- Trend Background: Color-coded regime indication
Signal Interpretation:
EXTREME Conviction (Whale Emoji Labels):
These are the highest confidence signals. Large volume with significant price impact, aligned with trend, showing follow-through. These often mark the beginning or continuation of strong moves.
HIGH Conviction (Large Triangles):
Strong signals meeting most criteria. Good for main entries or adding to positions.
MEDIUM Conviction (Small Triangles):
Whale activity present but with fewer confirmation factors. Use for partial positions or require additional confirmation.
Flow Strength Meter:
- Above zero and rising: Bullish flow building
- Below zero and falling: Bearish flow building
- Approaching ±50: Extreme readings, watch for exhaustion
- Crossing zero: Flow regime change
Dashboard Information:
The top-right table shows:
- Current regime (bullish/bearish/sideways)
- Flow strength value
- Last whale direction
- Conviction level of last whale
- Current volume ratio
- Flow momentum direction
- Indicator status
Trading Strategies:
Trend Following: Take EXTREME and HIGH conviction signals aligned with the flow meter direction. Enter when flow is positive and rising for bullish whales, negative and falling for bearish whales.
Regime-Based: Only trade in bullish/bearish regimes (colored backgrounds). Avoid trading in sideways regimes where whale moves tend to reverse quickly.
Flow Reversals: When flow meter crosses zero with EXTREME conviction whale in the new direction, this often marks regime changes.
Exhaustion Plays: When flow reaches ±50 extreme levels, watch for EXTREME conviction whales in the opposite direction as potential reversal signals.
TECHNICAL DETAILS
Volume Ratio = Current Volume / SMA(Volume, Period)
Price Impact % = ABS(Close - Open) / Open × 100
Whale Detected = (Volume Ratio >= Multiplier) AND (Price Impact >= Minimum)
Whale Direction = Close > Open ? 1 : -1
Base Conviction = (Volume Ratio × Price Impact %) / 10
Trend Alignment = Whale Direction == Trend Direction ? 1.5 : 1.0
Follow-Through = Price continues whale direction over N bars ? 1.3 : 1.0
Volume Persistence = SMA(Volume Ratio, 3) > 1.5 ? 1.2 : 1.0
Final Conviction = Base × Trend Alignment × Follow-Through × Volume Persistence
Whale Flow = Whale Detected ? (Volume Ratio × Price Impact × Direction) : 0
Cumulative Flow = EMA(Whale Flow, 20)
Flow Momentum = Change(Cumulative Flow, 5)
Flow Acceleration = Change(Momentum, 3)
Normalized Flow Strength = (Cumulative Flow / Highest(ABS(Cumulative Flow), 100)) × 100
WHAT THIS SOLVES
Common Volume Indicator Problems:
- Volume spikes that don't move price (consolidation noise)
- Price moves on low volume that quickly reverse
- No differentiation between strong and weak volume signals
- Treating all high-volume bars equally regardless of context
- No measure of whether volume represents conviction or panic
Whale Flow Solutions:
- Requires both volume AND price impact for signals
- Conviction scoring separates strong moves from weak ones
- Cumulative flow shows persistent pressure vs isolated spikes
- Trend alignment and follow-through filter low-quality signals
- Tiered system lets traders choose their confidence threshold
LIMITATIONS
- Cannot identify individual whales or attribute volume to specific entities
- High volume can come from many sources (whales, retail panic, algo activity)
- Works best on liquid assets with consistent volume patterns
- Less reliable on low-volume assets or during market closures
- Conviction scoring thresholds may need adjustment per asset/timeframe
- Does not predict future whale activity, only identifies it after bars close
- Flow can remain at extremes longer than expected during strong trends
- False signals can occur during news events or earnings
- Not a standalone trading system - requires risk management and other analysis
Best used in combination with price action, support/resistance, and broader market context.
EDUCATIONAL VALUE
For traders learning about:
- Volume analysis beyond simple volume indicators
- Multi-factor signal confirmation systems
- Market regime and flow concepts
- Conviction-based scoring methodologies
- Cumulative indicator design
- Normalized plotting for cross-asset comparison
- Pine Script table and dashboard creation
Not financial advice.
סקריפט מוגן
סקריפט זה פורסם כמקור סגור. עם זאת, אתה יכול להשתמש בו באופן חופשי וללא כל הגבלה - למד עוד כאן.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
סקריפט מוגן
סקריפט זה פורסם כמקור סגור. עם זאת, אתה יכול להשתמש בו באופן חופשי וללא כל הגבלה - למד עוד כאן.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.