# Help with daily RVOL for Intraday timeframes

#### luicius

##### New member
From my understanding, aggregation periods seems to work mainly with price rather than volume.
How do I get daily RVOL values on intraday timeframes?

Code:
``````input threshold = 3.0;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

def agg = AggregationPeriod.DAY;
def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
def relVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);

AddLabel(yes, Concat("RVOL: ", AsText(relVol,NumberFormat.TWO_DECIMAL_PLACES)), color.white);``````

Solution
@rad14733, thanks for your response. I figured out a solution.

Code:
``````input threshold = 3.0;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

def dailyRelVol = volume(period = AggregationPeriod.DAY);
def rawRelVol = (dailyRelVol - Average(dailyRelVol, length)) / StDev(dailyRelVol, length);
def relVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);

AddLabel(yes, Concat("RVOL: ", AsText(relVol,NumberFormat.TWO_DECIMAL_PLACES)), color.white);``````

#### rad14733

##### Well-known member
VIP
@luicius For that you would use the volume of each chart bar, just as you use price of each chart bar... After all, it's all relative... #### luicius

##### New member
@rad14733, thanks for your response. I figured out a solution.

Code:
``````input threshold = 3.0;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

def dailyRelVol = volume(period = AggregationPeriod.DAY);
def rawRelVol = (dailyRelVol - Average(dailyRelVol, length)) / StDev(dailyRelVol, length);
def relVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);

AddLabel(yes, Concat("RVOL: ", AsText(relVol,NumberFormat.TWO_DECIMAL_PLACES)), color.white);``````

• rad14733