 # Average 30 daily Volume Scan Filter

#### dmillz

##### Member
VIP
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
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.
YO! thank you so much!

• Pensar

#### Dillinger4

##### New member
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

#### Dillinger4

##### New member
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.

#### Dillinger4

##### New member
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.

#### Dillinger4

##### New member
Volume_Change was the trick.