PROTECTED SOURCE SCRIPT
Intradayscanner - Rvol

This indicator delivers a session-precise Relative Volume (RVol) metric using an advanced, performance-optimized method that goes beyond standard volume-vs-average calculations:
Session-Aligned Cumulative Volume
Tracks intraday volume from each session’s true open using a rolling array of session start bar indices.
Prunes old sessions to maintain high performance even on long history (max_bars_back=5000).
Binary-Search History Lookup
Employs a binary-search algorithm to find the exact bar corresponding to each prior session’s close, accounting for weekends/holidays.
Ensures the N-day average is built from perfectly aligned session volumes rather than simple bar-counts.
Configurable Threshold & Coloring
Computes RVol = (today’s cumulative volume) ÷ (N-day average cumulative volume).
Highlights high-volume conditions when RVol exceeds a user-defined threshold (High Volume Threshold).
Optional line-coloring by price direction (up/down) for immediate visual context.
Background Shading for Volume Spikes
Applies semi-transparent colored backgrounds when RVol > 1 (and above the threshold), making significant volume surges unmissable.
Customizable Lookback & Precision
User inputs for N-day average length, threshold multiplier, and color-by-previous-close toggle.
Designed for up to 5000 bars of history without performance degradation.
Session-Aligned Cumulative Volume
Tracks intraday volume from each session’s true open using a rolling array of session start bar indices.
Prunes old sessions to maintain high performance even on long history (max_bars_back=5000).
Binary-Search History Lookup
Employs a binary-search algorithm to find the exact bar corresponding to each prior session’s close, accounting for weekends/holidays.
Ensures the N-day average is built from perfectly aligned session volumes rather than simple bar-counts.
Configurable Threshold & Coloring
Computes RVol = (today’s cumulative volume) ÷ (N-day average cumulative volume).
Highlights high-volume conditions when RVol exceeds a user-defined threshold (High Volume Threshold).
Optional line-coloring by price direction (up/down) for immediate visual context.
Background Shading for Volume Spikes
Applies semi-transparent colored backgrounds when RVol > 1 (and above the threshold), making significant volume surges unmissable.
Customizable Lookback & Precision
User inputs for N-day average length, threshold multiplier, and color-by-previous-close toggle.
Designed for up to 5000 bars of history without performance degradation.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.