PROTECTED SOURCE SCRIPT
Volume Anomaly Candles

Volume Anomaly Candles — Hampel + RVOL (V-Anom)
This indicator colors candles in real time to highlight meaningful volume participation while filtering noise.
It combines two complementary engines:
• Hampel (robust anomaly detection): detects statistically rare volume spikes using median + MAD (robust σ).
• RVOL (Relative Volume tiers): measures volume relative to its baseline (volume / SMA(volume) and maps it into 3 intensity levels.
The goal is simple: make candles “stand out” only when volume is genuinely significant.
────────────────────────────────────────
Candle coloring logic
────────────────────────────────────────
A) Hampel Engine (Robust Volume Anomalies)
The Hampel engine computes a robust z-score on volume (hScore):
Typical volume = median(volume) over a rolling window
Deviation = |volume - median|
Robust dispersion = MAD → σ (sigma = 1.4826 * MAD)
hScore = (volume - median) / sigma
If volume is abnormally high, candles are colored as:
• Moderate anomaly
• Extreme anomaly
Important:
Hampel fires only on positive anomalies (hScore > 0), meaning volume is above the robust median.
This is intentional: it focuses on participation spikes (where activity matters most).
B) RVOL Engine (Relative Volume Levels)
RVOL is computed as:
RVOL = volume / SMA(volume, Baseline length)
Candles are colored by tier:
• Level 1: above-baseline participation
• Level 2: strong participation
• Level 3: exceptional participation
Bull/Bear colors are selected from candle direction (close ≥ open = bullish).
────────────────────────────────────────
Hampel vs RVOL priority
────────────────────────────────────────
Controlled by:
“Hampel overrides RVOL”
• ON (recommended):
If Hampel fires, Hampel colors the candle
Otherwise RVOL colors it
→ rare + significant gets priority
• OFF:
If RVOL fires, RVOL colors the candle
Otherwise Hampel colors it
→ more frequent coloring, more “active” tape
────────────────────────────────────────
Parameters and how they impact candles
────────────────────────────────────────
A) Adaptive Hampel thresholds (percentiles)
When enabled, thresholds adapt to market conditions by learning what is “rare” in recent score history.
• Adaptation window (hALen)
Higher: steadier thresholds, fewer Hampel candles, slower adaptation
Lower: faster adaptation, more Hampel candles, more sensitivity
• Moderate / Extreme percentile
Higher: more selective, fewer signals
Lower: more permissive, more signals
• Min σ floors
Higher: prevents overly permissive thresholds in quiet markets (fewer signals)
Lower: allows more signals in low-activity regimes
• Threshold smoothing (EMA)
Higher: smoother regime transitions
Lower: quicker threshold changes
B) Hampel window + static thresholds
• Window length (hLen)
Higher: more stable, macro anomaly detection
Lower: more reactive, may pick up micro-noise on very short TFs
• Moderate / Extreme σ thresholds
Higher: fewer Hampel candles, only premium spikes
Lower: more Hampel candles, denser highlighting
C) RVOL baseline + tiers
• Baseline length (rLen)
Higher: smoother RVOL, fewer tier switches
Lower: more reactive RVOL, more tier switches
• Tier thresholds (rThr1 / rThr2 / rThr3)
Higher: fewer RVOL candles (only big participation)
Lower: more RVOL candles (more active visualization)
Recommended spacing (default):
1.4 / 1.9 / 2.6
This keeps Level 1 meaningful, makes Level 2 clearly stronger than Level 1, and preserves Level 3 as rare.
D) Don’t color doji
Prevents coloring on neutral candles to reduce “false attention” bars.
────────────────────────────────────────
Practical use
────────────────────────────────────────
Use this tool as a participation overlay, not as a direction predictor:
• Breakout confirmation: stronger when the breakout candle is colored (RVOL L2/L3 or Hampel).
• Key level reactions: watch colored candles at VWAP, Kijun, FVG, range highs/lows.
• Volume events: extreme anomalies often mark important decision points.
Notes:
• Settings are in bars, not time. The same window behaves differently on M1 vs M15.
• The indicator highlights participation, not direction. Combine with structure and bias.
Disclaimer / Risk Warning
Trading involves substantial risk and is not suitable for everyone. Markets can move rapidly and unpredictably. You can lose part or all of your capital, and in leveraged products (futures, CFDs, margin, crypto derivatives), losses may exceed your initial deposit. Past performance is not indicative of future results.
This indicator is NOT financial advice.
Volume Anomaly Candles is a visual analysis tool designed to highlight relative and statistically unusual volume activity. It does not generate guaranteed buy/sell signals, does not predict direction, and should not be used as a standalone decision system.
Always confirm signals with your own analysis (market structure, key levels, risk management) and use appropriate position sizing, stop-losses, and risk controls. You are solely responsible for any trades you take based on this tool.
If you are unsure about the risks, seek independent financial advice from a licensed professional in your jurisdiction.
Made pinescript V6 by Onyx
This indicator colors candles in real time to highlight meaningful volume participation while filtering noise.
It combines two complementary engines:
• Hampel (robust anomaly detection): detects statistically rare volume spikes using median + MAD (robust σ).
• RVOL (Relative Volume tiers): measures volume relative to its baseline (volume / SMA(volume) and maps it into 3 intensity levels.
The goal is simple: make candles “stand out” only when volume is genuinely significant.
────────────────────────────────────────
Candle coloring logic
────────────────────────────────────────
A) Hampel Engine (Robust Volume Anomalies)
The Hampel engine computes a robust z-score on volume (hScore):
Typical volume = median(volume) over a rolling window
Deviation = |volume - median|
Robust dispersion = MAD → σ (sigma = 1.4826 * MAD)
hScore = (volume - median) / sigma
If volume is abnormally high, candles are colored as:
• Moderate anomaly
• Extreme anomaly
Important:
Hampel fires only on positive anomalies (hScore > 0), meaning volume is above the robust median.
This is intentional: it focuses on participation spikes (where activity matters most).
B) RVOL Engine (Relative Volume Levels)
RVOL is computed as:
RVOL = volume / SMA(volume, Baseline length)
Candles are colored by tier:
• Level 1: above-baseline participation
• Level 2: strong participation
• Level 3: exceptional participation
Bull/Bear colors are selected from candle direction (close ≥ open = bullish).
────────────────────────────────────────
Hampel vs RVOL priority
────────────────────────────────────────
Controlled by:
“Hampel overrides RVOL”
• ON (recommended):
If Hampel fires, Hampel colors the candle
Otherwise RVOL colors it
→ rare + significant gets priority
• OFF:
If RVOL fires, RVOL colors the candle
Otherwise Hampel colors it
→ more frequent coloring, more “active” tape
────────────────────────────────────────
Parameters and how they impact candles
────────────────────────────────────────
A) Adaptive Hampel thresholds (percentiles)
When enabled, thresholds adapt to market conditions by learning what is “rare” in recent score history.
• Adaptation window (hALen)
Higher: steadier thresholds, fewer Hampel candles, slower adaptation
Lower: faster adaptation, more Hampel candles, more sensitivity
• Moderate / Extreme percentile
Higher: more selective, fewer signals
Lower: more permissive, more signals
• Min σ floors
Higher: prevents overly permissive thresholds in quiet markets (fewer signals)
Lower: allows more signals in low-activity regimes
• Threshold smoothing (EMA)
Higher: smoother regime transitions
Lower: quicker threshold changes
B) Hampel window + static thresholds
• Window length (hLen)
Higher: more stable, macro anomaly detection
Lower: more reactive, may pick up micro-noise on very short TFs
• Moderate / Extreme σ thresholds
Higher: fewer Hampel candles, only premium spikes
Lower: more Hampel candles, denser highlighting
C) RVOL baseline + tiers
• Baseline length (rLen)
Higher: smoother RVOL, fewer tier switches
Lower: more reactive RVOL, more tier switches
• Tier thresholds (rThr1 / rThr2 / rThr3)
Higher: fewer RVOL candles (only big participation)
Lower: more RVOL candles (more active visualization)
Recommended spacing (default):
1.4 / 1.9 / 2.6
This keeps Level 1 meaningful, makes Level 2 clearly stronger than Level 1, and preserves Level 3 as rare.
D) Don’t color doji
Prevents coloring on neutral candles to reduce “false attention” bars.
────────────────────────────────────────
Practical use
────────────────────────────────────────
Use this tool as a participation overlay, not as a direction predictor:
• Breakout confirmation: stronger when the breakout candle is colored (RVOL L2/L3 or Hampel).
• Key level reactions: watch colored candles at VWAP, Kijun, FVG, range highs/lows.
• Volume events: extreme anomalies often mark important decision points.
Notes:
• Settings are in bars, not time. The same window behaves differently on M1 vs M15.
• The indicator highlights participation, not direction. Combine with structure and bias.
Disclaimer / Risk Warning
Trading involves substantial risk and is not suitable for everyone. Markets can move rapidly and unpredictably. You can lose part or all of your capital, and in leveraged products (futures, CFDs, margin, crypto derivatives), losses may exceed your initial deposit. Past performance is not indicative of future results.
This indicator is NOT financial advice.
Volume Anomaly Candles is a visual analysis tool designed to highlight relative and statistically unusual volume activity. It does not generate guaranteed buy/sell signals, does not predict direction, and should not be used as a standalone decision system.
Always confirm signals with your own analysis (market structure, key levels, risk management) and use appropriate position sizing, stop-losses, and risk controls. You are solely responsible for any trades you take based on this tool.
If you are unsure about the risks, seek independent financial advice from a licensed professional in your jurisdiction.
Made pinescript V6 by Onyx
Skrip terproteksi
Skrip ini diterbitkan sebagai sumber tertutup. Namun, Anda dapat menggunakannya dengan bebas dan tanpa batasan apa pun – pelajari lebih lanjut di sini.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip terproteksi
Skrip ini diterbitkan sebagai sumber tertutup. Namun, Anda dapat menggunakannya dengan bebas dan tanpa batasan apa pun – pelajari lebih lanjut di sini.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.