OPEN-SOURCE SCRIPT

Market Participation Index [PhenLabs]

229
📊 Market Participation Index [PhenLabs]
Version: PineScript™ v6

📌 Description
Market Participation Index is a well-evolved statistical oscillator that constantly learns to develop by adapting to changing market behavior through the intricate mathematical modeling process. MPI combines different statistical approaches and Bayes’ probability theory of analysis to provide extensive insight into market participation and building momentum. MPI combines diverse statistical thinking principles of physics and information and marries them for subtle changes to occur in markets, levels to become influential as important price targets, and pattern divergences to unveil before it is visible by analytical methods in an old-fashioned methodology.

🚀 Points of Innovation:
  • Automatic market condition detection system with intelligent preset selection
  • Multi-statistical approach combining classical and advanced metrics
  • Fractal-based divergence system with quality scoring
  • Adaptive threshold calculation using statistical properties of current market


🚨 Important🚨
The ‘Auto’ mode intelligently selects the optimal preset based on real-time market conditions, if the visualization does not appear to the best of your liking then select the option in parenthesis next to the auto mode on the label in the oscillator in the settings panel.


🔧 Core Components
Statistical Foundation: Multiple statistical measures combined with weighted approach
Market Condition Analysis: Real-time detection of market states (trending, ranging, volatile)
Change Point Detection: Bayesian analysis for finding significant market structure shifts
Divergence System: Fractal-based pattern detection with quality assessment
Adaptive Visualization: Dynamic color schemes with context-appropriate settings

🔥 Key Features

The indicator provides comprehensive market analysis through:
  • Multi-statistical Oscillator: Combines Z-score, MAD, and fractal dimensions
  • Advanced Statistical Components: Includes skewness, kurtosis, and entropy analysis
  • Auto-preset System: Automatically selects optimal settings for current conditions
  • Fractal Divergence Analysis: Detects and grades quality of divergence patterns
  • Adaptive Thresholds: Dynamically adjusts overbought/oversold levels


🎨 Visualization
  • Color-coded Oscillator: Gradient-filled oscillator line showing intensity
  • Divergence Markings: Clear visualization of bullish and bearish divergences
  • Threshold Lines: Dynamic or fixed overbought/oversold levels
  • Preset Information: On-chart display of current market conditions
  • Multiple Color Schemes: Modern, Classic, Monochrome, and Neon themes

Classic
snapshot
Modern
snapshot
Monochrome
snapshot
Neon
snapshot
📖 Usage Guidelines
The indicator offers several customization options:

Market Condition Settings:
  • Preset Mode: Choose between Auto-detection or specific market condition presets
  • Color Theme: Select visual theme matching your chart style
  • Divergence Labels: Choose whether or not you’d like to see the divergence


✅ Best Use Cases:
  • Identify potential market reversals through statistical divergences
  • Detect changes in market structure before price confirmation
  • Filter trades based on current market condition (trending vs. ranging)
  • Find optimal entry and exit points using adaptive thresholds
  • Monitor shifts in market participation and momentum


⚠️ Limitations
  • Requires sufficient historical data for accurate statistical analysis
  • Auto-detection may lag during rapid market condition changes
  • Advanced statistical calculations have higher computational requirements
  • Manual preset selection may be required in certain transitional markets


💡 What Makes This Unique
Statistical Depth: Goes beyond traditional indicators with advanced statistical measures
Adaptive Intelligence: Automatically adjusts to current market conditions
Bayesian Analysis: Identifies statistically significant change points in market structure
Multi-factor Approach: Combines multiple statistical dimensions for confirmation
Fractal Divergence System: More robust than traditional divergence detection methods

🔬 How It Works
The indicator processes market data through four main components:

Market Condition Analysis:
  • Evaluates trend strength, volatility, and price patterns
  • Automatically selects optimal preset parameters
  • Adapts sensitivity based on current conditions


Statistical Oscillator:
  • Combines multiple statistical measures with weights
  • Normalizes values to consistent scale
  • Applies adaptive smoothing


Advanced Statistical Analysis:
  • Calculates higher-order statistical moments
  • Applies information-theoretic measures
  • Detects distribution anomalies


Divergence Detection:
  • Uses fractal theory to identify pivot points
  • Detects and scores divergence quality
  • Filters signals based on current market phase


💡 Note:
The Market Participation Index performs optimally when used across multiple timeframes for confirmation. Its statistical foundation makes it particularly valuable during market transitions and periods of changing volatility, where traditional indicators often fail to provide clear signals.

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.