OPEN-SOURCE SCRIPT
Cập nhật

RVol+ Enhanced Relative Volume Indicator

138
📊 RVol+ Enhanced Relative Volume Indicator
Overview
RVol+ (Relative Volume Plus) is an advanced time-based relative volume indicator designed specifically for swing traders and breakout detection. Unlike simple volume comparisons, RVol+ analyzes volume at the same time of day across multiple sessions, providing statistically significant insights into institutional activity and breakout potential.
🎯 Key Features
Core Volume Analysis

Time-Based RVol Calculation - Compares current cumulative volume to the average volume at this exact time over the past N days
Statistical Z-Score - Measures volume in standard deviations from the mean for true anomaly detection
Volume Percentile - Shows where current volume ranks historically (0-100%)
Sustained Volume Filter - 3-bar moving average prevents false signals from single-bar spikes

Breakout Detection

🚀 Confirmed Breakouts - Identifies price breakouts validated by high volume (RVol > 1.5x)
⚠️ False Breakout Warnings - Alerts when price breaks key levels on low volume (high failure risk)
Multi-Timeframe Context - Weekly volume overlay prevents chasing daily noise

Advanced Metrics

OBV Divergence Detection - Spots bullish/bearish accumulation/distribution patterns
Volume Profile Integration - Identifies institutional positioning
Money Flow Analysis - Tracks smart money vs retail activity
Extreme Volume Alerts - 🔥 Labels mark unusual spikes beyond the display cap

Visual Intelligence

Smart Color Coding:

🟢 Bright Teal = High activity (RVol ≥ 1.5x)
🟡 Medium Teal = Caution zone (RVol ≥ 1.2x)
⚪ Light Teal = Normal activity
🟠 Orange = Breakout confirmed
🔴 Red = False breakout risk


Comprehensive Stats Table:

Current Volume (formatted as M/K/B)
RVol ratio
Z-Score with significance
Volume percentile
Historical average and standard deviation
Sustained volume confirmation



📈 How to Use
For Swing Trading (1D - 3W Holds)
Perfect Setup:
✓ RVol > 1.5x (bright teal)
✓ Z-Score > 2.0 (⚡ alert)
✓ Percentile > 90%
✓ Sustained = ✓
✓ 🚀 Breakout label appears
Avoid:
✗ Red "Low Vol" warning during breakouts
✗ RVol < 1.0 at key levels
✗ Sustained volume not confirmed
Signal Interpretation

⚡ Z>2 Labels - Statistically significant volume (95th+ percentile) - highest probability moves
↗️ OBV+ Labels - Bullish accumulation (OBV rising while price consolidates)
↘️ OBV- Labels - Bearish distribution (OBV falling while price rises)
🔵 Blue Background - Weekly volume elevated (confirms daily strength)

⚙️ Customization
Basic Settings

N Day Average - Number of historical days for comparison (default: 5)
RVol Thresholds - Customize highlight levels (default: 1.2x, 1.5x)
Visual Display Cap - Prevent extreme spikes from compressing view (default: 4.0x)

Advanced Metrics (Toggle On/Off)

Z-Score analysis
Weekly RVol context
OBV divergence detection
Volume percentile ranking
Breakout signal generation

Table Customization

Position - 9 placement options to avoid chart overlap
Size - Tiny to Huge
Colors - Full customization of positive/negative/neutral values
Transparency - Adjustable background

Debug Mode

Enable Pine Logs for calculation transparency
Adjustable log frequency
Real-time calculation breakdown

🔬 Technical Details
Algorithm:

Binary search for historical lookups (O(log n) performance)
Time-zone aware session detection
DST-safe timestamp calculations
Exponentially weighted standard deviation
Anti-repainting architecture

Performance:

Optimized for max_bars_back = 5000
Efficient array management
Built-in function optimization
Memory-conscious data structures

📊 What Makes RVol+ Different?
vs. Standard Volume:

Context-aware (time-of-day matters)
Statistical significance testing
False breakout filtering

vs. Basic RVol:

Z-Score normalization (2-3 sigma detection)
Multi-timeframe confirmation
OBV divergence integration
Sustained volume filtering
Smart visual scaling

vs. Professional Tools:

Free and open-source
Fully customizable
No black-box algorithms
Educational debug logs

💡 Best Practices

Wait for Confirmation - Don't enter on first bar; wait for sustained volume ✓
Combine with Price Action - RVol validates, price structure determines entry
Weekly Context Matters - Blue background = institutional interest
Z-Score is King - Focus on ⚡ alerts for highest probability
Avoid Low Volume Breakouts - Red ⚠️ labels = high failure risk

🎓 Trading Psychology
Volume precedes price. When RVol+ shows:

High RVol + Rising OBV = Accumulation before breakout
High RVol at Resistance = Test of conviction
Low RVol on Breakout = Retail-driven (fade candidate)
Z-Score > 3 = Potential "whale" positioning

📝 Credits
Based on the time-based RVol concept from /u/HurlTeaInTheSea, enhanced with:

Statistical analysis (z-scores, percentiles)
Multi-timeframe integration
OBV divergence detection
Professional-grade visualization
Swing trading optimization

🔧 Version History
v2.0 - Enhanced Edition

Added Z-Score analysis
Multi-timeframe volume context
OBV divergence detection
Breakout confirmation system
Smart color coding
Customizable stats table
Debug logging mode
Performance optimizations

📚 Learn More
For optimal use with swing trading:

Combine with support/resistance levels
Watch for volume clusters in consolidation
Use weekly timeframe for trend confirmation
Monitor OBV divergence for early warnings

⚠️ Disclaimer
This indicator is for educational purposes. Volume analysis is one component of trading decisions. Always use proper risk management, consider multiple timeframes, and validate signals with price structure. Past performance does not guarantee future results.

🚀 Getting Started

Add indicator to chart
Adjust "N Day Average" to your preference (5-10 days typical)
Position stats table to avoid overlap
Enable features you want to monitor
Watch for 🚀 breakout confirmations!

Happy Trading! 📈
Phát hành các Ghi chú
Complete Reading Guide for Enhanced RVol Indicator
Visual Elements Overview
Bottom Pane (Main Display):

RVol Histogram (colored bars) - Your relative volume metric
Volume Overlay (hollow bars with colored borders) - Actual volume scaled to fit
Volume MA (orange line) - Moving average of volume
Reference Lines - 1.0x (normal), 1.2x (caution), 1.5x (high)

Top Table - Real-time metrics with color-coded values

Reading the Volume Overlay
Hollow Bar Colors

Green border = Bullish bar (close > open)
Red border = Bearish bar (close < open)
Height = Actual volume magnitude (scaled)

Key Relationships to Watch
1. Volume vs RVol Alignment

When hollow volume bars are TALL and RVol is HIGH (teal/bright): Strong confirmation of unusual activity
When hollow bars are TALL but RVol is LOW (gray): High absolute volume, but normal for this time of day
When hollow bars are SHORT but RVol is HIGH: Less absolute volume, but unusually high for this specific time

2. Volume Direction + RVol Level

Green volume + High RVol (>1.5x): Bullish accumulation with conviction
Red volume + High RVol (>1.5x): Bearish distribution with conviction
Mixed colors + High RVol: Churn/indecision despite high activity

3. Volume MA Relationship

When hollow bars consistently above orange MA: Sustained elevated volume period
When hollow bars below MA: Quieter than recent average
MA crossing through volume bars: Transition point in volume regime


New Metrics Explained
Volume Run Rate (0-100)
What it measures: How fast volume is accumulating compared to historical pace
How to read:

80-100 (green): Extremely fast volume accumulation - stock is "hot"
50-79 (yellow): Above-average pace but not extreme
0-49 (red): Below-average pace - slow day

Trading application:

High run rate early in session (first 30-60 min) often predicts active day
Run rate above 85 with price breakout = strong signal
Low run rate on attempted breakout = weak signal, possible false move

DCR - Daily Closing Range (%)
What it measures: Where current price sits within today's range
How to read:

70-100% (green): Closing near highs - bullish intraday structure
30-70% (yellow): Middle of range - neutral/choppy
0-30% (red): Closing near lows - bearish intraday structure

Trading application:

DCR >70% + High RVol = Strong uptrend continuation signal
DCR <30% + High RVol = Strong downtrend or capitulation
DCR bouncing from <30% to >50% = Potential reversal
DCR stuck in middle + high volume = Distribution/churn

Above VWAP (✓/✗)
What it shows: Whether price is above or below session VWAP
How to read:

✓ (green): Price above VWAP - institutional buying likely, bullish bias
✗ (red): Price below VWAP - institutional selling likely, bearish bias

Trading application:

Price crossing above VWAP + Volume spike = Bullish momentum shift
Holding above VWAP all day = Institutional support
Failed attempt to reclaim VWAP = Weakness
Multiple touches of VWAP = Key pivot level


Combined Reading Strategies
Strategy 1: Breakout Confirmation
Look for:

RVol >1.5x (teal/bright bars)
Volume overlay showing tall GREEN bars
Volume Run Rate >70
DCR >60%
Above VWAP = ✓

Signal: High-conviction bullish breakout
Strategy 2: False Breakout Detection
Look for:

Price making new highs BUT
RVol <1.2x (gray bars)
Volume overlay showing SHORT bars
Volume Run Rate <50
DCR rising but volume declining

Signal: Weak breakout likely to fail
Strategy 3: Reversal Setup
Look for:

DCR drops to <30% (red)
Then RVol spikes >1.5x with GREEN volume bars
Volume Run Rate jumps from <50 to >70
Price crosses above VWAP (✗ → ✓)

Signal: Potential bottom formation
Strategy 4: Distribution Warning
Look for:

High RVol (>1.5x) BUT
RED volume bars dominating
DCR dropping from >70% to <50%
Sustained = ✗ (meaning 3-bar RVol stays elevated)
Price losing VWAP

Signal: Smart money exiting, avoid longs

Time-of-Day Context
Market Open (9:30-10:30 AM):

Volume overlay will be tallest (highest absolute volume)
RVol may be lower than you expect (this is normal for open)
Focus on Volume Run Rate to gauge if it's an unusually active open
DCR is still forming, less reliable

Mid-Morning (10:30 AM-12:00 PM):

RVol becomes most reliable
Volume overlay bars should be shorter (lunch lull approaching)
If RVol stays high here with tall volume bars = very significant
DCR starts becoming meaningful

Afternoon (1:00-3:00 PM):

Typically quietest period
Even moderate RVol (1.3x) can be significant
Volume overlay bars should be smallest
Watch for unusual spikes here (often news-driven)

Power Hour (3:00-4:00 PM):

Volume overlay bars grow again
RVol may spike but verify it's unusual for this time
DCR becomes critical - shows how day will close
Above/Below VWAP + volume tells you if institutions defending levels


Practical Example Reading
Scenario you see:

RVol: 2.1x (bright teal)
Volume overlay: Tall GREEN hollow bars, above MA
Run Rate: 78/100 (yellow)
DCR: 68% (yellow/green)
VWAP: ✓
Time: 10:15 AM

Interpretation:
Stock is experiencing significantly above-average volume (2.1x) with bullish participation (green bars). The run rate of 78 confirms volume is accumulating quickly. Price is holding in upper 68% of range and above VWAP, showing institutional support. This is a strong bullish setup, especially if this follows a consolidation or breakout.
Action: Consider long entries with stops below VWAP or recent consolidation low.

Key Principle
The power of this indicator is in the convergence of signals. One metric alone is interesting, but when RVol, volume direction, run rate, DCR, and VWAP position all align, the signal strength multiplies dramatically.
Always ask: "Do ALL the metrics agree on the story, or are there divergences?" Divergences often reveal the truth behind apparent price action.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.