OPEN-SOURCE SCRIPT

Relative Volume Context [Alturoi]

523
Relative Volume Context evaluates whether current volume is unusual relative to its historical time-of-day or calendar context.

Instead of comparing volume to a global average, the script estimates expected volume for the current time bucket (e.g., minute of hour, hour of day, day of week, month). This creates a like-for-like comparison against historical behavior occurring at the same structural moment.

All outputs are derived from a single statistical volume model.

How It Works

For each selected time bucket, the script maintains:

  • Sample size (N)
  • Mean volume (expected value)
  • Variance (used for Z-Score)


When a new bar forms, current volume is compared to the historical statistics of its bucket.

This produces:

  • Expected Volume – Typical volume for this time bucket
  • Difference – Actual minus expected
  • Surprise (%) – Relative deviation from expected
  • Z-Score – Standardized deviation from the historical distribution
  • Sample Size & Confidence – Transparency into statistical reliability


Optional session-aware bucketing allows intraday traders to model volume relative to session structure.

Why Time Conditioning Matters

Volume follows structural patterns (open, midday, close, weekday effects).
Comparing current volume to a global average ignores these effects.

By conditioning volume on time, the indicator helps distinguish:

  • Routine activity
  • Statistically elevated participation
  • Structurally quiet periods


How to Use

This indicator is designed as a contextual tool, not a trading signal.

It may assist in:

  • Evaluating whether breakouts occur with elevated participation
  • Distinguishing routine session volume from abnormal spikes
  • Assessing whether price movement is supported by unusual activity


Interpret readings alongside price structure and risk management.

Disclaimer

This script is provided for educational and informational purposes only and does not constitute financial advice. Trading involves risk, and past behavior does not guarantee future results.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.