# Average 30 daily Volume Scan Filter

#### dmillz

##### Member
Hi, Peeps

Looking for a code for average daily volume for the last 30 days between 1 million and 30 million.

Wanting to implement this into my scan filter so i can filter out low volume stocks

Thanks!!!

#### Pensar

##### Well-known member
VIP
@dmillz This should scan for the average volume of the last 30 bars to be greater than 1M. `plot scan = average(volume,30) > 1000000;` There are 252 trading days in a year, so if you are looking for a true month's worth of average time, you might want to change the length of bars to 21. Make sure you choose a daily agg as the scan timeframe.

• dmillz

#### dmillz

##### Member
@dmillz This should scan for the average volume of the last 30 bars to be greater than 1M. `plot scan = average(volume,30) > 1000000;` There are 252 trading days in a year, so if you are looking for a true month's worth of average time, you might want to change the length of bars to 21. Make sure you choose a daily agg as the scan timeframe.
YO! thank you so much!

• Pensar
D

#### Dillinger4

##### Guest
Hope everyone is doing well. Probably a pretty simple problem to solve but I am at a loss. I am trying to have a scanner return results if volume >= volLast30DayAvg but I am not sure of the syntax to achieve this.

Code:
``````def volLast30DayAvg = (volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY")) / 30;

def today = volume(period = "DAY");``````

????

#### XeoNoX

##### Well-known member
VIP
Hope everyone is doing well. Probably a pretty simple problem to solve but I am at a loss. I am trying to have a scanner return results if volume >= volLast30DayAvg but I am not sure of the syntax to achieve this.

Code:
``````def volLast30DayAvg = (volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY") + volume(period = "DAY")) / 30;

def today = volume(period = "DAY");``````

????
you can do this with the condition wizard:

you can learn how to use the condition wizard via

hint: choose volume on one side and volumeavg on the other side with greater than or equal to in the middle

• Dillinger4
D

#### Dillinger4

##### Guest
you can do this with the condition wizard:

you can learn how to use the condition wizard via

hint: choose volume on one side and volumeavg on the other side with greater than or equal to in the middle
Xenox, thank you for the help. Great video. Sounds like a dynamic alert is what I need. Trying to find how to create one. Right now I just see Study Alert within my TOS platform.

D

#### Dillinger4

##### Guest
Xenox, thank you for the help. Great video. Sounds like a dynamic alert is what I need. Trying to find how to create one. Right now I just see Study Alert within my TOS platform.
Digging into this it seems a little complex. Since I already have two studies coded it would probably be much easier for me to just figure out the line/lines of code that I need instead of reinventing the wheel.

D

#### Dillinger4

##### Guest
Volume_Change was the trick. ## 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?