OPEN-SOURCE SCRIPT

UDVR + OBV Combo — MTF (v6)

63
The UDVR + OBV Combo is a multi-timeframe volume analysis tool that blends the Up/Down Volume Ratio with a normalized On-Balance Volume signal. It highlights when accumulation or distribution truly supports price action, adds higher-timeframe context, and shades the background when both indicators align. Use it to confirm breakouts, spot divergences, and filter trades with the backing of real volume flows.

1.Up/Down Volume Ratio (UDVR)
•Compares the rolling sum of up-volume (bars where price closed higher) vs down-volume (bars where price closed lower).
•A ratio > 1.0 = more accumulation (bullish pressure).
•A ratio < 1.0 = more distribution (bearish pressure).
•Optional histogram shows deviations from the 1.0 baseline.
•Customizable handling of equal closes (count as up, down, split, or ignore).
•Configurable lookback length and optional EMA smoothing.

2. On-Balance Volume (OBV)
•Classic cumulative OBV implemented natively (adds volume on up-bars, subtracts on down-bars).
•Normalized with a z-score so it can be compared across different symbols/timeframes.
•Includes an EMA signal line for slope detection.
•Alignment of OBV vs its EMA highlights rising or waning participation.

3. Multi-Timeframe Support
•Both UDVR and OBV can be plotted from a higher timeframe (HTF) (e.g. Daily UDVR shown on a 1h chart).
•Lets you see big-money accumulation/distribution while trading intraday.
•Shaded background when current TF and HTF agree (both bullish or both bearish).

How to read it
Bullish confirmation = UDVR > 1 (accumulation) and OBV above EMA (rising participation).
Bearish confirmation = UDVR < 1 (distribution) and OBV below EMA (falling participation).
Mixed signals (e.g. UDVR > 1 but OBV falling) = caution; price may lack conviction.
Divergences: If price makes a new high but OBV or UDVR does not, it’s a warning of weakening trend.
Higher timeframe context: set HTF = Daily or Weekly and watch how short-term signals align with institutional flows. A long trade on the 15m chart is stronger when Daily UDVR is also above 1.

Inputs
•UDVR Lookback: number of bars for rolling volume sums.
•Smoothing EMA: smooths UDVR for stability.
•Equal Close Handling: decide how equal closes affect UDVR.
•Signal Band: optional UDVR extreme thresholds.
•Show Histogram: toggle UDVR histogram around baseline.
•Higher Timeframe UDVR: overlay Daily/Weekly UDVR on lower timeframe charts.
•OBV EMA length: slope proxy for normalized OBV.
•OBV Normalization window: controls z-score sensitivity.
•Higher Timeframe OBV: overlay higher timeframe OBV.

Alerts
•UDVR Bullish/Bearish cross at the 1.0 baseline.
•OBV slope up/down when OBV crosses its EMA.
•Alignment signals when UDVR and OBV agree (both confirm bullish or bearish conditions).

Why it’s useful
•Combines trend, momentum, and participation in one place.
•Helps avoid false breakouts by checking if volume supports the move.
•Lets you spot accumulation/distribution shifts before they show up in price.
•Gives a higher timeframe context so you’re not trading against the “big picture.”

Once applied, the indicator creates a dedicated pane below price with the following components:

UDVR Line (green/red)
• Green when UDVR > 1.0 (more up-volume than down-volume → accumulation).
• Red when UDVR < 1.0 (more down-volume → distribution).

UDVR Baseline and Bands
• Grey baseline at 1.0 = balance between buying and selling volume.
• Optional upper/lower bands (default 1.5 and 0.67) highlight extreme imbalances.
• Shaded areas between baseline and bands provide visual context for strength/weakness.

UDVR Histogram (optional)
• Columns around the baseline showing (UDVR – 1.0).
• Quick way to gauge how far above/below balance the ratio is.

Higher-Timeframe UDVR (teal line)
• Overlays the UDVR from a higher timeframe (e.g. Daily) on your intraday chart.
• Lets you see whether institutional flows support your shorter-term signals.

OBV Normalized (blue/orange line)
• Classic OBV, but normalized with a z-score so it stays readable across assets.
• Blue when OBV is above its EMA (rising participation).
• Orange when below its EMA (waning participation).

OBV EMA (grey line)
• Signal line showing the slope of OBV.
• Crosses between OBV and this line mark shifts in participation.

Higher-Timeframe OBV (purple line, optional)
• Plots OBV from a higher timeframe for additional context.

Background Shading
• Light green = both UDVR > 1 and OBV > OBV-EMA (bullish alignment).
• Light red = both UDVR < 1 and OBV < OBV-EMA (bearish alignment).

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.