OPEN-SOURCE SCRIPT

Momentum Pressure Gauge [JOAT]

872
Momentum Pressure Gauge

Introduction

The Momentum Pressure Gauge is an advanced institutional-grade analysis tool designed to measure the underlying buying and selling pressure that drives market movements. This indicator goes beyond simple momentum oscillators by quantifying the actual pressure differential between buyers and sellers, incorporating volume analysis, detecting divergences, and identifying when momentum is reaching extreme levels. Understanding pressure and momentum is crucial because price often follows pressure - by measuring the force behind price movements, traders can anticipate future direction with greater confidence.

This tool is built for traders who understand that markets are driven by the constant battle between buyers and sellers, and that the outcome of this battle is reflected in pressure and momentum patterns. Whether you're a day trader timing entries with precision, a swing trader identifying trend strength, or a position trader spotting major reversals, this gauge provides the sophisticated pressure analysis needed to trade with the dominant force rather than against it.

لقطة

Why This Indicator Exists

Most traders use basic momentum indicators without understanding the underlying pressure dynamics or volume participation. This indicator addresses that limitation by:

  • Pressure Analysis: Measures actual buying/selling pressure in each bar
  • Volume Weighting: Incorporates volume to confirm pressure significance
  • Momentum Scoring: Provides composite momentum scores with multiple factors
  • Divergence Detection: Identifies price/momentum divergences for early reversal signals
  • Extreme Zone Identification: Flags overbought/oversold conditions with pressure context
  • Energy Wave Analysis: Combines pressure with volume and price energy


The gauge transforms abstract momentum concepts into concrete pressure measurements that reveal the true force behind market movements.

Core Components Explained

1. Raw Pressure Calculation

The indicator measures buying and selling pressure in each bar:

Pine Script®
// Raw buying/selling pressure f_pressure_raw() => float range_val = high - low float buy_pressure = range_val > 0 ? (close - low) / range_val : 0.5 float sell_pressure = range_val > 0 ? (high - close) / range_val : 0.5 [buy_pressure, sell_pressure] // Apply smoothing float pressure_ratio = ta.ema(raw_buy, i_pressure_len) float pressure_smooth = ta.ema(pressure_ratio, i_smooth_len)


Pressure components:
  • Buy Pressure: Where price closed within the bar's range (0-1)
  • Sell Pressure: Complementary sell pressure (0-1)
  • Pressure Ratio: Buy pressure as a ratio
  • Smoothing: EMA smoothing for cleaner signals
  • Range Normalization: Pressure relative to bar's range


Pressure above 0.5 indicates buying dominance, below 0.5 indicates selling dominance.

2. Volume-Weighted Pressure

Volume analysis confirms the significance of pressure:

Pine Script®
// Volume relative strength float vol_sma = ta.sma(volume, i_pressure_len) float vol_ratio = vol_sma > 0 ? volume / vol_sma : 1.0 float vol_weight = math.min(vol_ratio, 3.0) / 3.0 // Cap at 3x average // Volume-weighted pressure float vw_pressure = pressure_smooth * (0.7 + vol_weight * 0.3) // Cumulative pressure float cum_pressure = ta.sma(raw_buy, i_pressure_len) - 0.5 // Centered at 0


Volume features:
  • Volume Ratio: Current volume relative to average
  • Volume Weight: Normalized volume influence (0-1)
  • VW Pressure: Pressure adjusted for volume participation
  • Cumulative Pressure: Running pressure average
  • Volume Cap: Prevents extreme volume from distorting signals


High volume confirms pressure significance, while low volume questions its reliability.

3. Momentum Analysis

Multiple momentum factors are combined for comprehensive analysis:

Pine Script®
// Pressure momentum (rate of change) float pressure_momentum = pressure_smooth - pressure_smooth[i_momentum_len] // Pressure acceleration float pressure_accel = pressure_momentum - pressure_momentum[i_momentum_len] // Composite pressure score (-100 to +100) float composite_score = (pressure_smooth - 0.5) * 200 // Momentum-adjusted score float momentum_adjustment = pressure_momentum * 100 float adjusted_score = composite_score + momentum_adjustment * 0.3


Momentum components:
  • Pressure Momentum: Rate of change in pressure
  • Pressure Acceleration: Change in momentum (second derivative)
  • Composite Score: Normalized pressure score (-100 to +100)
  • Momentum Adjustment: Score adjusted for momentum
  • Acceleration Detection: Identifies momentum shifts


Momentum analysis reveals not just current pressure but its direction and acceleration.

4. WaveTrend Integration

The WaveTrend oscillator adds an additional momentum layer:

Pine Script®
f_wavetrend(int channel_len, int avg_len) => float ap = hlc3 float esa = ta.ema(ap, channel_len) float d = ta.ema(math.abs(ap - esa), channel_len) float ci = d > 0 ? (ap - esa) / (0.015 * d) : 0.0 float wt1_local = ta.ema(ci, avg_len) float wt2_local = ta.sma(wt1_local, 4) [wt1_local, wt2_local] // WaveTrend signals bool wt_bullish = wt1 > wt2 and wt1 > wt1[1] bool wt_bearish = wt1 < wt2 and wt1 < wt1[1] bool wt_oversold = wt1 < -60 bool wt_overbought = wt1 > 60


WaveTrend features:
  • WT1/WT2 Lines: Fast and slow WaveTrend lines
  • Cross Signals: Line crossovers for momentum changes
  • Extreme Levels: Overbought (>60) and oversold (<-60)
  • Trend Confirmation: Line slope for additional confirmation
  • Integration: Combined with pressure for confluence


WaveTrend provides an independent momentum confirmation.

لقطة

5. Energy Wave Calculation

The indicator combines multiple energy sources:

Pine Script®
// Energy combines pressure momentum with volume energy float vol_energy = vol_sma > 0 ? (volume - vol_sma) / vol_sma * 100 : 0 float atr_14 = ta.atr(14) float price_energy = atr_14 > 0 ? (close - open) / atr_14 * 100 : 0 float combined_energy = (pressure_momentum * 100 + vol_energy * 0.3 + price_energy * 0.2) / 1.5 float energy_smooth = ta.ema(combined_energy, 5)


Energy components:
  • Volume Energy: Volume deviation from average
  • Price Energy: Price movement relative to ATR
  • Pressure Energy: Momentum contribution
  • Combined Energy: Weighted average of all energies
  • Energy Smoothing: EMA for cleaner energy signals


Energy waves show the underlying power driving market movements.

6. Divergence Detection

The indicator identifies price/momentum divergences:

Pine Script®
// Price direction float price_change = close - close[i_momentum_len] int price_dir = price_change > 0 ? 1 : price_change < 0 ? -1 : 0 // Pressure direction int pressure_dir = pressure_momentum > i_momentum_thresh ? 1 : pressure_momentum < -i_momentum_thresh ? -1 : 0 // Divergence detection bool bullish_divergence = price_dir == -1 and pressure_dir == 1 bool bearish_divergence = price_dir == 1 and pressure_dir == -1


Divergence types:
  • Bullish Divergence: Price falling but pressure rising
  • Bearish Divergence: Price rising but pressure falling
  • Hidden Divergence: Continuation patterns
  • Regular Divergence: Reversal patterns
  • Threshold Filter: Minimum momentum for valid divergence


Divergences often precede significant price reversals.

7. State Classification System

The indicator classifies market states based on pressure:

Pine Script®
// Pressure state // 2 = extreme buying, 1 = buying, 0 = neutral, -1 = selling, -2 = extreme selling var int pressure_state = 0 if pressure_smooth >= i_extreme_high pressure_state := 2 else if pressure_smooth > 0.5 + i_momentum_thresh pressure_state := 1 else if pressure_smooth <= i_extreme_low pressure_state := -2 else if pressure_smooth < 0.5 - i_momentum_thresh pressure_state := -1 // Momentum state // 1 = accelerating, 0 = steady, -1 = decelerating var int momentum_state = 0 if pressure_accel > i_momentum_thresh / 2 momentum_state := 1 else if pressure_accel < -i_momentum_thresh / 2 momentum_state := -1


State meanings:
  • Extreme Buying: Maximum buying pressure (>70%)
  • Buying: Moderate buying pressure (50-70%)
  • Neutral: Balanced pressure (40-60%)
  • Selling: Moderate selling pressure (30-50%)
  • Extreme Selling: Maximum selling pressure (<30%)
  • Accelerating: Momentum increasing
  • Decelerating: Momentum decreasing


State classification provides clear, actionable market conditions.

لقطة

Visual Elements

  • Pressure Histogram: Main pressure display with gradient coloring
  • Multi-Layer Glow: Intensity-based glow effects
  • Energy Wave: Separate energy visualization
  • Momentum Line: Momentum rate of change
  • WaveTrend Lines: Additional momentum confirmation
  • Divergence Markers: Visual divergence signals
  • Extreme Zones: Highlighted overbought/oversold areas
  • Dashboard: Comprehensive metrics panel
  • Signal Labels: Key event labels with spacing


The dashboard displays:
1. Current pressure state and intensity
2. Momentum state and acceleration
3. Composite score and direction
4. Volume weight and analysis
5. Divergence status and alerts
6. Energy wave readings
7. Confluence quality score
8. WaveTrend status and signals
9. Overall signal strength

Input Parameters

Pressure Settings:
  • Pressure Period: Pressure calculation period (default: 14)
  • Smoothing Period: EMA smoothing (default: 5)
  • Momentum Lookback: Momentum calculation (default: 10)


Thresholds:
  • Extreme Buying: Maximum buying level (default: 0.7)
  • Extreme Selling: Maximum selling level (default: 0.3)
  • Momentum Threshold: Minimum momentum (default: 0.05)


WaveTrend Settings:
  • Channel Length: WT calculation period (default: 9)
  • Average Length: WT smoothing period (default: 12)
  • Enable WT: Toggle WaveTrend on/off


Visual Settings:
  • Color Scheme: Customizable pressure colors
  • Glow Effects: Enable visual enhancements
  • Show Zones: Display extreme zones
  • Show Labels: Control signal label frequency


لقطة

How to Use This Indicator

Step 1: Assess Pressure State
Check the dashboard for current pressure state. Extreme states (>70% or <30%) often precede reversals, while moderate states suggest continuation.

Step 2: Analyze Momentum
Look at momentum direction and acceleration. Accelerating momentum in the pressure direction confirms strength, while deceleration warns of potential reversals.

Step 3: Check Volume Confirmation
Ensure pressure is supported by volume. High volume pressure is more reliable than low volume pressure.

Step 4: Watch for Divergences
Divergences are powerful reversal signals. A bullish divergence (price down, pressure up) suggests buying opportunity, while bearish divergence suggests selling.

Step 5: Monitor Energy Waves
Energy waves show the underlying power. Rising energy confirms current pressure, while falling energy suggests weakening.

Step 6: Use Extreme Zones
Extreme buying (>70%) often marks tops, while extreme selling (<30%) often marks bottoms. These are contrarian signals.

Best Practices

  • Extreme pressure states (>70% or <30%) often precede reversals
  • Divergences are most reliable at extreme levels
  • Volume confirmation is essential - pressure without volume is suspect
  • Momentum acceleration confirms pressure strength
  • Energy waves provide early warning of momentum shifts
  • Multiple timeframe analysis improves signal reliability
  • Combine with trend analysis for optimal results
  • Use WaveTrend crossovers for additional confirmation
  • Keep a pressure journal to track patterns
  • Be patient for the highest quality setups


Trading Applications

Momentum Trading:
  • Enter when pressure > 60% and accelerating
  • Add to positions as momentum increases
  • Exit when pressure decelerates or reverses
  • Use volume to confirm signal strength


Reversal Trading:
  • Look for extreme pressure (>70% or <30%)
  • Wait for divergence confirmation
  • Enter on first sign of pressure reversal
  • Target mean reversion to 50% level


Divergence Trading:
  • Identify clear price/pressure divergences
  • Confirm with volume and energy analysis
  • Enter on momentum shift confirmation
  • Use tight stops due to reversal nature


Strategy Integration

This indicator enhances any trading system:

  • Use pressure as a trend confirmation filter
  • Import momentum scores for signal weighting
  • Apply divergence detection for early warnings
  • Use extreme zones for contrarian signals
  • Integrate volume-weighted pressure for confirmation
  • Export pressure states for custom logic


Technical Implementation

Built with Pine Script v6 featuring:
  • Advanced pressure calculation with range normalization
  • Volume-weighted analysis with capping
  • Multi-factor momentum scoring system
  • WaveTrend oscillator integration
  • Energy wave calculation combining multiple sources
  • Sophisticated divergence detection with thresholds
  • State classification with multiple dimensions
  • Multi-layer visualization with glow effects
  • Real-time dashboard with 10 key metrics
  • Alert conditions for all major pressure events


The code uses confirmed bars for all calculations to prevent repainting.

Originality Statement

This indicator is original in its comprehensive approach to pressure and momentum analysis. While individual components (RSI, MACD, WaveTrend) are established tools, this indicator is justified because:

  • It synthesizes pressure analysis with volume weighting for more accurate signals
  • The energy wave concept combines multiple momentum sources into unified analysis
  • State classification provides clear, actionable market conditions
  • Divergence detection includes threshold filtering for higher quality signals
  • Multi-layer visualization with glow effects enhances readability
  • The dashboard presents complex pressure dynamics in an accessible format
  • Volume-weighted pressure adds confirmation often missing from momentum indicators
  • Acceleration analysis provides early warning of momentum shifts
  • Export functions enable integration with any trading system
  • Each component provides unique insights: pressure shows force, volume shows participation, momentum shows direction, energy shows power, and divergence shows potential reversals


The indicator's value lies in measuring the underlying forces that drive price movements rather than just tracking price itself, providing traders with deeper insight into market dynamics and potential future direction.

Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Pressure and momentum analysis is a tool for understanding market forces, not a prediction system.

Pressure and momentum can change suddenly due to news events, economic data, or changes in market sentiment. Extreme pressure states can persist longer than expected, and divergences can fail without warning. The indicator's signals are mathematical calculations based on historical patterns and should be used in conjunction with other forms of analysis.

Always use proper risk management, including stop losses and position sizing appropriate for your account and risk tolerance. Never trade against strong pressure without confirmation - the trend can remain in force longer than your account can survive.

The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this system.

-Made with passion by officialjackofalltrades

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.