OPEN-SOURCE SCRIPT
Relative Volume Context [Alturoi]

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:
When a new bar forms, current volume is compared to the historical statistics of its bucket.
This produces:
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:
How to Use
This indicator is designed as a contextual tool, not a trading signal.
It may assist in:
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.
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.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Built for traders who value structure, discipline, and evidence over noise. 🔗 alturoi.com
Alturoi provides content for educational use only. Past performance is not indicative of future outcomes.
Alturoi provides content for educational use only. Past performance is not indicative of future outcomes.
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.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Built for traders who value structure, discipline, and evidence over noise. 🔗 alturoi.com
Alturoi provides content for educational use only. Past performance is not indicative of future outcomes.
Alturoi provides content for educational use only. Past performance is not indicative of future outcomes.
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.