Volume Weighted Median Oscillator [AlgoAlpha]🟠 OVERVIEW
This script measures price movement relative to a volume-weighted median instead of a simple average. It builds an oscillator that reflects where price is positioned compared to the level where most trading activity is concentrated. This helps reduce the effect of outliers and highlights more balanced price zones.
The output combines a momentum histogram and a smoothed oscillator line, both normalized by recent price range. It also includes a signal line and visual zones to show when price is stretched relative to its volume-based center.
🟠 CONCEPTS
Volume-Weighted Median — The price level where half of the traded volume occurred above and half below within the lookback window.
Normalized Momentum — The difference between current price and the weighted median, divided by an average price range to keep values comparable across markets.
Median Trend Deviation — The distance between the median and its longer-term EMA, used to define the main oscillator direction.
Volume Normalization — Current volume divided by its moving average to highlight periods of higher activity.
Signal Line — An EMA of the oscillator used to track short-term direction changes.
🟠 FEATURES
Dual Output Structure — Combines histogram and oscillator line.
• Histogram shows short-term momentum shifts.
• Oscillator line reflects broader deviation from median trend.
Optional Smoothing — Applies WMA smoothing to reduce noise in both outputs.
Dynamic Ribbon — Visual fill between oscillator and signal line.
• Changes color based on direction.
• Intensity reflects strength of separation.
Overbought and Oversold Zones — Gradient fills beyond defined thresholds.
• Expands visually as extremes increase.
• Helps identify stretched conditions.
Volume-Aware Zero Line — Brightness increases when current volume exceeds its average.
Volume-Weighted Median Core — Uses sorted price and volume arrays to compute a true weighted median.
• Reduces sensitivity to spikes compared to mean-based indicators.
• Anchors calculations to where trading activity is concentrated.
Built-in Alerts — Includes conditions for crosses, zone entries, and ribbon flips.
🟠 HOW TO USE
Watch the histogram crossing above or below zero — shows short-term momentum shifts relative to the median.
Use the main oscillator crossing zero — indicates broader directional bias change.
Track crosses between the oscillator and its signal line — helps identify early trend shifts.
Observe entries into extreme zones — signals that price is stretched relative to its volume center.
Pay attention to ribbon color changes — confirms alignment between momentum and trend.
Check zero line brightness — higher brightness suggests stronger participation behind moves.
🟠 CONCLUSION
Volume Weighted Median Oscillator combines a volume-based median, normalized momentum, and trend deviation into one view. It focuses on where trading activity is concentrated instead of simple averages. This gives a clearer read on price imbalance and helps traders judge when moves are supported or stretched.
Pine Script® indicator






















