OPEN-SOURCE SCRIPT
Market Profile Dominance Analyzer

# Market Profile Dominance Analyzer
## 📊 OVERVIEW
**Market Profile Dominance Analyzer** is an advanced multi-factor indicator that combines Market Profile methodology with composite dominance scoring to identify buyer and seller strength across higher timeframes. Unlike traditional volume profile indicators that only show volume distribution, or simple buyer/seller indicators that only compare candle colors, this script integrates six distinct analytical components into a unified dominance measurement system.
This indicator helps traders understand **WHO controls the market** by analyzing price position relative to Market Profile key levels (POC, Value Area) combined with volume distribution, momentum, and trend characteristics.
## 🎯 WHAT MAKES THIS ORIGINAL
### **Hybrid Analytical Approach**
This indicator uniquely combines two separate methodologies that are typically analyzed independently:
1. **Market Profile Analysis** - Calculates Point of Control (POC) and Value Area (VA) using volume distribution across price channels on higher timeframes
2. **Multi-Factor Dominance Scoring** - Weights six independent factors to produce a composite dominance index
### **Six-Factor Composite Analysis**
The dominance score integrates:
- Price position relative to POC (equilibrium assessment)
- Price position relative to Value Area boundaries (acceptance/rejection zones)
- Volume imbalance within Value Area (institutional bias detection)
- Price momentum (directional strength)
- Volume trend comparison (participation analysis)
- Normalized Value Area position (precise location within fair value zone)
### **Adaptive Higher Timeframe Integration**
The script features an intelligent auto-selection system that automatically chooses appropriate higher timeframes based on the current chart period, ensuring optimal Market Profile structure regardless of the trading timeframe being analyzed.
## 💡 HOW IT WORKS
### **Market Profile Construction**
The indicator builds a Market Profile structure on a higher timeframe by:
1. **Session Identification** - Detects new higher timeframe sessions using `request.security()` to ensure accurate period boundaries
2. **Data Accumulation** - Stores high, low, and volume data for all bars within the current higher timeframe session
3. **Channel Distribution** - Divides the session's price range into configurable channels (default: 20 rows)
4. **Volume Mapping** - Distributes each bar's volume proportionally across all price channels it touched
### **Key Level Calculation**
**Point of Control (POC)**
- Identifies the price channel with the highest accumulated volume
- Represents the price level where the most trading activity occurred
- Serves as a magnetic level where price often returns
**Value Area (VA)**
- Starts at POC and expands both upward and downward
- Includes channels until reaching the specified percentage of total volume (default: 70%)
- Expansion algorithm compares adjacent volumes and prioritizes the direction with higher activity
- Defines the "fair value" zone where most market participants agreed to trade
### **Dominance Score Formula**
```
Dominance Score = (price_vs_poc × 10) +
(price_vs_va × 5) +
(volume_imbalance × 0.5) +
(price_momentum × 100) +
(volume_trend × 5) +
(va_position × 15)
```
**Component Breakdown:**
- **price_vs_poc**: +1 if above POC, -1 if below (shows which side of equilibrium)
- **price_vs_va**: +2 if above VAH, -2 if below VAL, 0 if inside VA
- **volume_imbalance**: Percentage difference between upper and lower VA volumes
- **price_momentum**: 5-period SMA of price change (directional acceleration)
- **volume_trend**: Compares 5-period vs 20-period volume averages
- **va_position**: Normalized position within Value Area (-1 to +1)
The composite score is then smoothed using EMA with configurable sensitivity to reduce noise while maintaining responsiveness.
### **Market State Determination**
- **BUYERS Dominant**: Smooth dominance > +10 (bullish control)
- **SELLERS Dominant**: Smooth dominance < -10 (bearish control)
- **NEUTRAL**: Between -10 and +10 (balanced market)
## 📈 HOW TO USE THIS INDICATOR
### **Trend Identification**
- **Green background** indicates buyers are in control - look for long opportunities
- **Red background** indicates sellers are in control - look for short opportunities
- **Gray background** indicates neutral market - consider range-bound strategies
### **Signal Interpretation**
**Buy Signals** (green triangle) appear when:
- Dominance crosses above -10 from oversold conditions
- Previous state was not already bullish
- Suggests shift from seller to buyer control
**Sell Signals** (red triangle) appear when:
- Dominance crosses below +10 from overbought conditions
- Previous state was not already bearish
- Suggests shift from buyer to seller control
### **Value Area Context**
Monitor the information table (top-right) to understand market structure:
- **Price vs POC**: Shows if trading above/below equilibrium
- **Volume Imbalance**: Positive values favor buyers, negative favors sellers
- **Market State**: Current dominant force (BUYERS/SELLERS/NEUTRAL)
### **Multi-Timeframe Strategy**
The auto-timeframe feature analyzes higher timeframe structure:
- On 1-minute charts → analyzes 2-hour structure
- On 5-minute charts → analyzes Daily structure
- On 15-minute charts → analyzes Weekly structure
- On Daily charts → analyzes Yearly structure
This higher timeframe context helps avoid counter-trend trades against the dominant force.
### **Confluence Trading**
Strongest signals occur when multiple factors align:
1. Price above VAH + positive volume imbalance + buyers dominant = Strong bullish setup
2. Price below VAL + negative volume imbalance + sellers dominant = Strong bearish setup
3. Price at POC + neutral state = Potential breakout/breakdown pivot
## ⚙️ INPUT PARAMETERS
- **Higher Time Frame**: Select specific HTF or use 'Auto' for intelligent selection
- **Value Area %**: Percentage of volume contained in VA (default: 70%)
- **Show Buy/Sell Signals**: Toggle signal triangles visibility
- **Show Dominance Histogram**: Toggle histogram display
- **Signal Sensitivity**: EMA period for dominance smoothing (1-20, default: 5)
- **Number of Channels**: Market Profile resolution (10-50, default: 20)
- **Color Settings**: Customize buyer, seller, and neutral colors
## 🎨 VISUAL ELEMENTS
- **Histogram**: Shows smoothed dominance score (green = buyers, red = sellers)
- **Zero Line**: Neutral equilibrium reference
- **Overbought/Oversold Lines**: ±50 levels marking extreme dominance
- **Background Color**: Highlights current market state
- **Information Table**: Displays key metrics (state, dominance, POC relationship, volume imbalance, timeframe, bars in session, total volume)
- **Signal Shapes**: Triangle markers for buy/sell signals
## 🔔 ALERTS
The indicator includes three alert conditions:
1. **Buyers Dominate** - Fires on buy signal crossovers
2. **Sellers Dominate** - Fires on sell signal crossovers
3. **Dominance Shift** - Fires when dominance crosses zero line
## 📊 BEST PRACTICES
### **Timeframe Selection**
- **Scalping (1-5min)**: Focus on 2H-4H dominance shifts
- **Day Trading (15-60min)**: Monitor Daily and Weekly structure
- **Swing Trading (4H-Daily)**: Track Weekly and Monthly dominance
### **Confirmation Strategies**
1. **Trend Following**: Enter in direction of dominance above/below ±20
2. **Reversal Trading**: Fade extreme readings beyond ±50 when diverging with price
3. **Breakout Trading**: Look for dominance expansion beyond ±30 with increasing volume
### **Risk Management**
- Avoid trading during NEUTRAL states (dominance between -10 and +10)
- Use POC levels as logical stop-loss placement
- Consider VAH/VAL as profit targets for mean reversion
## ⚠️ LIMITATIONS & WARNINGS
**Data Requirements**
- Requires sufficient historical data on current chart (minimum 100 bars recommended)
- Lower timeframes may show fewer bars per HTF session initially
- More accurate results after several complete HTF sessions have formed
**Not a Standalone System**
- This indicator analyzes market structure and participant control
- Should be combined with price action, support/resistance, and risk management
- Does not guarantee profitable trades - past dominance does not predict future results
**Repainting Characteristics**
- Higher timeframe levels (POC, VAH, VAL) update as new bars form within the session
- Dominance score recalculates with each new bar
- Historical signals remain fixed, but current session data is developing
**Volume Limitations**
- Uses exchange-provided volume data which varies by instrument type
- Forex and some CFDs use tick volume (not actual transaction volume)
- Most accurate on instruments with reliable volume data (stocks, futures, crypto)
## 🔍 TECHNICAL NOTES
**Performance Optimization**
- Uses `max_bars_back=5000` for extended historical analysis
- Efficient array management prevents memory issues
- Automatic cleanup of session data on new period
**Calculation Method**
- Market Profile uses actual volume distribution, not TPO (Time Price Opportunity)
- Value Area expansion follows traditional Market Profile auction theory
- All calculations occur on the chart's current symbol and timeframe
## 📚 EDUCATIONAL VALUE
This indicator helps traders understand:
- How institutional traders use Market Profile to identify fair value
- The relationship between price, volume, and market acceptance
- Multi-factor analysis techniques for assessing market conditions
- The importance of higher timeframe structure in trade planning
## 🎓 RECOMMENDED READING
To better understand the concepts behind this indicator:
- "Mind Over Markets" by James Dalton (Market Profile foundations)
- "Markets in Profile" by James Dalton (Value Area analysis)
- Volume Profile analysis in institutional trading
## 💬 USAGE TERMS
This indicator is provided as an educational and analytical tool. It does not constitute financial advice, investment recommendations, or trading signals. Users are responsible for their own trading decisions and should conduct their own research and due diligence.
Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
## 📊 OVERVIEW
**Market Profile Dominance Analyzer** is an advanced multi-factor indicator that combines Market Profile methodology with composite dominance scoring to identify buyer and seller strength across higher timeframes. Unlike traditional volume profile indicators that only show volume distribution, or simple buyer/seller indicators that only compare candle colors, this script integrates six distinct analytical components into a unified dominance measurement system.
This indicator helps traders understand **WHO controls the market** by analyzing price position relative to Market Profile key levels (POC, Value Area) combined with volume distribution, momentum, and trend characteristics.
## 🎯 WHAT MAKES THIS ORIGINAL
### **Hybrid Analytical Approach**
This indicator uniquely combines two separate methodologies that are typically analyzed independently:
1. **Market Profile Analysis** - Calculates Point of Control (POC) and Value Area (VA) using volume distribution across price channels on higher timeframes
2. **Multi-Factor Dominance Scoring** - Weights six independent factors to produce a composite dominance index
### **Six-Factor Composite Analysis**
The dominance score integrates:
- Price position relative to POC (equilibrium assessment)
- Price position relative to Value Area boundaries (acceptance/rejection zones)
- Volume imbalance within Value Area (institutional bias detection)
- Price momentum (directional strength)
- Volume trend comparison (participation analysis)
- Normalized Value Area position (precise location within fair value zone)
### **Adaptive Higher Timeframe Integration**
The script features an intelligent auto-selection system that automatically chooses appropriate higher timeframes based on the current chart period, ensuring optimal Market Profile structure regardless of the trading timeframe being analyzed.
## 💡 HOW IT WORKS
### **Market Profile Construction**
The indicator builds a Market Profile structure on a higher timeframe by:
1. **Session Identification** - Detects new higher timeframe sessions using `request.security()` to ensure accurate period boundaries
2. **Data Accumulation** - Stores high, low, and volume data for all bars within the current higher timeframe session
3. **Channel Distribution** - Divides the session's price range into configurable channels (default: 20 rows)
4. **Volume Mapping** - Distributes each bar's volume proportionally across all price channels it touched
### **Key Level Calculation**
**Point of Control (POC)**
- Identifies the price channel with the highest accumulated volume
- Represents the price level where the most trading activity occurred
- Serves as a magnetic level where price often returns
**Value Area (VA)**
- Starts at POC and expands both upward and downward
- Includes channels until reaching the specified percentage of total volume (default: 70%)
- Expansion algorithm compares adjacent volumes and prioritizes the direction with higher activity
- Defines the "fair value" zone where most market participants agreed to trade
### **Dominance Score Formula**
```
Dominance Score = (price_vs_poc × 10) +
(price_vs_va × 5) +
(volume_imbalance × 0.5) +
(price_momentum × 100) +
(volume_trend × 5) +
(va_position × 15)
```
**Component Breakdown:**
- **price_vs_poc**: +1 if above POC, -1 if below (shows which side of equilibrium)
- **price_vs_va**: +2 if above VAH, -2 if below VAL, 0 if inside VA
- **volume_imbalance**: Percentage difference between upper and lower VA volumes
- **price_momentum**: 5-period SMA of price change (directional acceleration)
- **volume_trend**: Compares 5-period vs 20-period volume averages
- **va_position**: Normalized position within Value Area (-1 to +1)
The composite score is then smoothed using EMA with configurable sensitivity to reduce noise while maintaining responsiveness.
### **Market State Determination**
- **BUYERS Dominant**: Smooth dominance > +10 (bullish control)
- **SELLERS Dominant**: Smooth dominance < -10 (bearish control)
- **NEUTRAL**: Between -10 and +10 (balanced market)
## 📈 HOW TO USE THIS INDICATOR
### **Trend Identification**
- **Green background** indicates buyers are in control - look for long opportunities
- **Red background** indicates sellers are in control - look for short opportunities
- **Gray background** indicates neutral market - consider range-bound strategies
### **Signal Interpretation**
**Buy Signals** (green triangle) appear when:
- Dominance crosses above -10 from oversold conditions
- Previous state was not already bullish
- Suggests shift from seller to buyer control
**Sell Signals** (red triangle) appear when:
- Dominance crosses below +10 from overbought conditions
- Previous state was not already bearish
- Suggests shift from buyer to seller control
### **Value Area Context**
Monitor the information table (top-right) to understand market structure:
- **Price vs POC**: Shows if trading above/below equilibrium
- **Volume Imbalance**: Positive values favor buyers, negative favors sellers
- **Market State**: Current dominant force (BUYERS/SELLERS/NEUTRAL)
### **Multi-Timeframe Strategy**
The auto-timeframe feature analyzes higher timeframe structure:
- On 1-minute charts → analyzes 2-hour structure
- On 5-minute charts → analyzes Daily structure
- On 15-minute charts → analyzes Weekly structure
- On Daily charts → analyzes Yearly structure
This higher timeframe context helps avoid counter-trend trades against the dominant force.
### **Confluence Trading**
Strongest signals occur when multiple factors align:
1. Price above VAH + positive volume imbalance + buyers dominant = Strong bullish setup
2. Price below VAL + negative volume imbalance + sellers dominant = Strong bearish setup
3. Price at POC + neutral state = Potential breakout/breakdown pivot
## ⚙️ INPUT PARAMETERS
- **Higher Time Frame**: Select specific HTF or use 'Auto' for intelligent selection
- **Value Area %**: Percentage of volume contained in VA (default: 70%)
- **Show Buy/Sell Signals**: Toggle signal triangles visibility
- **Show Dominance Histogram**: Toggle histogram display
- **Signal Sensitivity**: EMA period for dominance smoothing (1-20, default: 5)
- **Number of Channels**: Market Profile resolution (10-50, default: 20)
- **Color Settings**: Customize buyer, seller, and neutral colors
## 🎨 VISUAL ELEMENTS
- **Histogram**: Shows smoothed dominance score (green = buyers, red = sellers)
- **Zero Line**: Neutral equilibrium reference
- **Overbought/Oversold Lines**: ±50 levels marking extreme dominance
- **Background Color**: Highlights current market state
- **Information Table**: Displays key metrics (state, dominance, POC relationship, volume imbalance, timeframe, bars in session, total volume)
- **Signal Shapes**: Triangle markers for buy/sell signals
## 🔔 ALERTS
The indicator includes three alert conditions:
1. **Buyers Dominate** - Fires on buy signal crossovers
2. **Sellers Dominate** - Fires on sell signal crossovers
3. **Dominance Shift** - Fires when dominance crosses zero line
## 📊 BEST PRACTICES
### **Timeframe Selection**
- **Scalping (1-5min)**: Focus on 2H-4H dominance shifts
- **Day Trading (15-60min)**: Monitor Daily and Weekly structure
- **Swing Trading (4H-Daily)**: Track Weekly and Monthly dominance
### **Confirmation Strategies**
1. **Trend Following**: Enter in direction of dominance above/below ±20
2. **Reversal Trading**: Fade extreme readings beyond ±50 when diverging with price
3. **Breakout Trading**: Look for dominance expansion beyond ±30 with increasing volume
### **Risk Management**
- Avoid trading during NEUTRAL states (dominance between -10 and +10)
- Use POC levels as logical stop-loss placement
- Consider VAH/VAL as profit targets for mean reversion
## ⚠️ LIMITATIONS & WARNINGS
**Data Requirements**
- Requires sufficient historical data on current chart (minimum 100 bars recommended)
- Lower timeframes may show fewer bars per HTF session initially
- More accurate results after several complete HTF sessions have formed
**Not a Standalone System**
- This indicator analyzes market structure and participant control
- Should be combined with price action, support/resistance, and risk management
- Does not guarantee profitable trades - past dominance does not predict future results
**Repainting Characteristics**
- Higher timeframe levels (POC, VAH, VAL) update as new bars form within the session
- Dominance score recalculates with each new bar
- Historical signals remain fixed, but current session data is developing
**Volume Limitations**
- Uses exchange-provided volume data which varies by instrument type
- Forex and some CFDs use tick volume (not actual transaction volume)
- Most accurate on instruments with reliable volume data (stocks, futures, crypto)
## 🔍 TECHNICAL NOTES
**Performance Optimization**
- Uses `max_bars_back=5000` for extended historical analysis
- Efficient array management prevents memory issues
- Automatic cleanup of session data on new period
**Calculation Method**
- Market Profile uses actual volume distribution, not TPO (Time Price Opportunity)
- Value Area expansion follows traditional Market Profile auction theory
- All calculations occur on the chart's current symbol and timeframe
## 📚 EDUCATIONAL VALUE
This indicator helps traders understand:
- How institutional traders use Market Profile to identify fair value
- The relationship between price, volume, and market acceptance
- Multi-factor analysis techniques for assessing market conditions
- The importance of higher timeframe structure in trade planning
## 🎓 RECOMMENDED READING
To better understand the concepts behind this indicator:
- "Mind Over Markets" by James Dalton (Market Profile foundations)
- "Markets in Profile" by James Dalton (Value Area analysis)
- Volume Profile analysis in institutional trading
## 💬 USAGE TERMS
This indicator is provided as an educational and analytical tool. It does not constitute financial advice, investment recommendations, or trading signals. Users are responsible for their own trading decisions and should conduct their own research and due diligence.
Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
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.
🎉 Join our FREE open Telegram channel! Everyone welcome! 📱✨ t.me/smart_day_trader
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.
🎉 Join our FREE open Telegram channel! Everyone welcome! 📱✨ t.me/smart_day_trader
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.