OPEN-SOURCE SCRIPT

Phantom Whale Hunter [JOAT]

2 260
Phantom Whale Hunter

Introduction

The Phantom Whale Hunter is an advanced open-source institutional footprint tracking system that combines Chaikin Money Flow, Money Flow Index, On-Balance Volume, VWAP analysis, and Accumulation/Distribution to detect institutional buying and selling pressure. This indicator reveals when large institutional players (whales) are accumulating or distributing positions, providing traders with insights into smart money positioning before major price moves occur.

Unlike basic volume indicators, the Phantom Whale Hunter provides multi-dimensional institutional flow analysis through money flow calculations, volume-weighted analysis, cumulative volume tracking, and phase detection. The indicator is designed for traders who understand that institutional money moves markets and that detecting whale footprints early provides significant trading advantages.

snapshot

Why This Indicator Exists

This indicator addresses the need for systematic institutional flow analysis. By combining five distinct money flow methodologies with phase detection, it reveals:

  • Chaikin Money Flow (CMF): Measures buying/selling pressure based on close position within range
  • Money Flow Index (MFI): Volume-weighted RSI showing money flow strength
  • On-Balance Volume (OBV): Cumulative volume indicator tracking institutional accumulation/distribution
  • VWAP Analysis: Volume-weighted average price with deviation bands
  • Accumulation/Distribution (A/D): Cumulative indicator measuring money flow into/out of security
  • Institutional Flow Index: Composite measure combining all five components
  • Phase Detection: Classifies market as Strong Accumulation, Accumulation, Neutral, Distribution, or Strong Distribution
  • Smart Money Divergence: Detects when price and flow move in opposite directions


Core Components Explained

1. Chaikin Money Flow (CMF)

CMF measures the relationship between close position and volume:

  • Money Flow Volume: ((Close - Low) - (High - Close)) / (High - Low) × Volume
  • CMF Calculation: Sum of MFV over period / Sum of volume over period
  • CMF Smoothing: 7-period EMA for noise reduction
  • Interpretation: CMF > 0 = buying pressure, CMF < 0 = selling pressure


CMF values above +0.1 indicate strong buying pressure, while values below -0.1 indicate strong selling pressure.

2. Money Flow Index (MFI)

MFI is a volume-weighted momentum indicator:

  • Typical Price: (High + Low + Close) / 3
  • Raw Money Flow: Typical Price × Volume
  • Positive Flow: Money flow when typical price rises
  • Negative Flow: Money flow when typical price falls
  • Money Ratio: Sum of positive flow / Sum of negative flow
  • MFI: 100 - (100 / (1 + Money Ratio))


MFI above 80 indicates overbought with high volume (potential distribution), while MFI below 20 indicates oversold with high volume (potential accumulation).

3. On-Balance Volume (OBV)

OBV tracks cumulative volume flow:

  • Calculation: Add volume on up days, subtract volume on down days
  • Cumulative: Running total from start of data
  • Normalization: Scaled to 0-100 range using 100-bar high/low
  • Zero-Centering: Subtract 50 for composite integration


Rising OBV with rising price confirms uptrend (accumulation). Falling OBV with rising price warns of distribution.

4. VWAP (Volume-Weighted Average Price)

VWAP calculates the average price weighted by volume:

  • Calculation: Sum(Typical Price × Volume) / Sum(Volume)
  • Daily Reset: VWAP resets at start of each trading day
  • Standard Deviation: Measures price dispersion from VWAP
  • Deviation Bands: VWAP ± (StdDev × Multiplier)
  • Price vs VWAP: Percentage distance from VWAP


Price above VWAP indicates bullish institutional positioning. Price below VWAP indicates bearish institutional positioning. Large deviations often mean-revert.

5. Accumulation/Distribution (A/D) Line

A/D measures cumulative money flow:

  • Money Flow Multiplier: ((Close - Low) - (High - Close)) / (High - Low)
  • Money Flow Volume: Multiplier × Volume
  • A/D Line: Cumulative sum of money flow volume
  • Smoothing: EMA smoothing (default 14) for trend identification
  • Normalization: Scaled to 0-100 range, then zero-centered


Rising A/D with rising price confirms accumulation. Falling A/D with rising price signals distribution (bearish divergence).

6. Institutional Flow Index Calculation

All five components are combined into a unified flow index:

Flow Index = (CMF × 50 + (MFI - 50) + (OBV - 50) + (A/D - 50)) / 4

This composite index ranges from approximately -50 to +50, with:
  • Flow Index > 30 = Strong institutional buying
  • Flow Index > 10 = Institutional buying
  • Flow Index -10 to +10 = Neutral/balanced
  • Flow Index < -10 = Institutional selling
  • Flow Index < -30 = Strong institutional selling


7. Phase Detection System

The indicator classifies institutional positioning into five phases:

  • Strong Accumulation (Phase 2): Flow Index > 30, CMF > 0.1, MFI > 50
  • Accumulation (Phase 1): Flow Index > 10, CMF > 0
  • Neutral (Phase 0): Flow Index between -10 and +10
  • Distribution (Phase -1): Flow Index < -10, CMF < 0
  • Strong Distribution (Phase -2): Flow Index < -30, CMF < -0.1, MFI < 50


Phase classification helps identify when institutions are actively positioning.

8. Smart Money Divergence Detection

Divergences occur when price and flow move in opposite directions:

  • Price Momentum: 14-period rate of change in price
  • Flow Momentum: 14-period rate of change in Flow Index
  • Bullish Divergence: Price falling (momentum < 0), Flow rising (momentum > 0)
  • Bearish Divergence: Price rising (momentum > 0), Flow falling (momentum < 0)


Smart money divergences indicate institutions positioning against current price trend, often preceding reversals.

9. Institutional Pressure Detection

The indicator identifies strong institutional buying/selling:

  • Buy Pressure: CMF > 0, MFI > 50, OBV > 50, Volume Surge
  • Sell Pressure: CMF < 0, MFI < 50, OBV < 50, Volume Surge
  • Volume Surge: Current volume > average volume × 2.25
  • Anti-Overlap: Minimum 25 bars between pressure signals


Institutional pressure with volume confirmation indicates significant whale activity.

10. Flow Velocity and Acceleration

The indicator tracks flow momentum:

  • Flow Velocity: Change in Flow Index (first derivative)
  • Flow Acceleration: Change in velocity (second derivative)


Accelerating flow indicates increasing institutional participation. Decelerating flow warns of waning institutional interest.

Visual Elements

  • Institutional Flow Line: Main line showing composite flow with phase-based coloring (green = accumulation, red = distribution, yellow = neutral)
  • Component Lines: Four thin lines showing CMF, MFI, OBV, and A/D (all normalized)
  • Zero Line: Horizontal line at zero
  • Threshold Lines: Dashed lines at +30 (strong accumulation), +10 (accumulation), -10 (distribution), -30 (strong distribution)
  • Zone Fills: Shaded areas above +30 (green) and below -30 (red)
  • Volume Surge Background: Purple background when volume surges occur
  • Smart Money Divergence Circles: Small circles marking divergence points
  • Institutional Pressure Triangles: Triangles marking strong buy/sell pressure
  • Flow Velocity Histogram: Shows rate of change in flow
  • Information Dashboard: Displays phase, flow index, CMF, MFI, OBV, A/D, volume ratio, price vs VWAP, flow velocity, and signal status


snapshot

How to Use This Indicator

Step 1: Check Current Phase
Monitor the dashboard for institutional phase (Strong Accumulation, Accumulation, Neutral, Distribution, Strong Distribution).

Step 2: Analyze Flow Index
Flow Index > 20 = institutional buying, Flow Index < -20 = institutional selling. Trade in direction of institutional flow.

Step 3: Confirm with Components
Check CMF, MFI, OBV, and A/D for confirmation. All four positive = strongest accumulation signal.

Step 4: Monitor Volume Ratio
Volume surges (> 2x average) with positive flow confirm institutional buying. Volume surges with negative flow confirm institutional selling.

Step 5: Check Price vs VWAP
Price above VWAP with positive flow = bullish institutional positioning. Price below VWAP with negative flow = bearish institutional positioning.

Step 6: Watch for Smart Money Divergences
Divergences at extreme flow levels often precede reversals. Purple circles mark these critical points.

Step 7: Look for Institutional Pressure
Triangles mark strong institutional buy/sell pressure with volume confirmation. These are high-probability signals.

Best Practices

  • Trade in direction of institutional phase - don't fight whale positioning
  • Wait for Strong Accumulation/Distribution phases for highest conviction
  • Confirm flow signals with volume surges - flow without volume may be weak
  • Use smart money divergences as early reversal warnings
  • Monitor flow velocity - accelerating flow indicates increasing institutional participation
  • Combine with price action and support/resistance for entry timing
  • Be patient - institutional accumulation/distribution can take time
  • Use higher timeframe flow for stronger significance


Input Parameters

Chaikin Money Flow:
  • CMF Length: Period for CMF calculation (default: 20)


Money Flow Index:
  • MFI Length: Period for MFI calculation (default: 14)
  • MFI Overbought: Threshold for overbought (default: 80)
  • MFI Oversold: Threshold for oversold (default: 20)


Volume Configuration:
  • Volume MA Length: Period for average volume (default: 20)
  • Surge Threshold: Multiplier for volume surges (default: 2.0x)
  • Show Volume Profile: Toggle volume display (default: enabled)


VWAP Analysis:
  • VWAP Std Dev: Standard deviation multiplier (default: 2.0)


Accumulation/Distribution:
  • A/D Smoothing: EMA smoothing period (default: 14)
  • Phase Threshold: Threshold for phase classification (default: 0.5)


Visual Configuration:
  • Accumulation/Distribution/Neutral/Smart Money Colors: Customizable colors


Originality Statement

This indicator is original in its comprehensive institutional flow approach. While individual components (CMF, MFI, OBV, VWAP, A/D) are established concepts, this indicator is justified because:

  • It combines five distinct money flow methodologies into a unified institutional flow index
  • The phase detection system classifies institutional positioning systematically
  • Smart money divergence detection identifies when institutions position against price
  • Institutional pressure detection with volume confirmation reveals whale activity
  • Flow velocity and acceleration tracking predict institutional momentum changes
  • Integration of VWAP analysis provides institutional price positioning context
  • The comprehensive dashboard presents all institutional flow metrics simultaneously


Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Institutional flow analysis does not guarantee profitable trades. Whale activity does not guarantee price direction. Always use proper risk management and never risk more than you can afford to lose.

-Made with passion by officialjackofalltrades

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.