# Help with daily RVOL for Intraday timeframes

#### lucius

##### 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);

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);

@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...

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);

There is a build in RelativeVolumeStDev in TOS, did you tryed it?

87k+ Posts
196 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?