How do we calculate Relative Volume and Relative Volume at Time?

Relative Volume consists of Volume divided by Average Volume where Average Volume is a Simple Moving Average, calculated on the basis of the past 10 periods (not taking into account the current volume bar). 

Relative Volume = volume / average volume.

Here's the script that allows you to plot Relative Volume on your chart:

AvgVol = sma(volume,10)
plot(volume/AvgVol[1], title="Relative Volume")

It takes the last 10 bars and makes an SMA, and then divides the volume by this SMA to calculate Relative Volume.

Relative Volume is calculated on any available time interval, the list of which you may see by clicking the Time Interval button at the top of the screener. This means that when you change the interval, Relative Volume is recalculated.

Relative Volume is not calculated during Extended hours, only during regular trading sessions.


Relative Volume at Time however - instead of taking the last 10 bars - only takes the average volume of a single bar per day (for the last 10 days), whichever bar corresponds to the current time. For example, we're calculating Relative Volume at Time on an hourly (1h) time frame at 9:30. It takes the average volume of each 9:30 hourly bar for the last 10 days and calculates the relative volume based on that data. Like this, for each bar (candle) highlighted with the blue vertical line: