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

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!
 

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")[1] + volume(period = "DAY")[2] + volume(period = "DAY")[3] + volume(period = "DAY")[4] + volume(period = "DAY")[5] + volume(period = "DAY")[6] + volume(period = "DAY")[7] + volume(period = "DAY")[8] + volume(period = "DAY")[9] + volume(period = "DAY")[10] + volume(period = "DAY")[11] + volume(period = "DAY")[12] + volume(period = "DAY")[13] + volume(period = "DAY")[14] + volume(period = "DAY")[15] + volume(period = "DAY")[16] + volume(period = "DAY")[17] + volume(period = "DAY")[18] + volume(period = "DAY")[19] + volume(period = "DAY")[20] + volume(period = "DAY")[21] + volume(period = "DAY")[22] + volume(period = "DAY")[23] + volume(period = "DAY")[24] + volume(period = "DAY")[25] + volume(period = "DAY")[26] + volume(period = "DAY")[27] + volume(period = "DAY")[28] + volume(period = "DAY")[29] + volume(period = "DAY")[30]) / 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")[1] + volume(period = "DAY")[2] + volume(period = "DAY")[3] + volume(period = "DAY")[4] + volume(period = "DAY")[5] + volume(period = "DAY")[6] + volume(period = "DAY")[7] + volume(period = "DAY")[8] + volume(period = "DAY")[9] + volume(period = "DAY")[10] + volume(period = "DAY")[11] + volume(period = "DAY")[12] + volume(period = "DAY")[13] + volume(period = "DAY")[14] + volume(period = "DAY")[15] + volume(period = "DAY")[16] + volume(period = "DAY")[17] + volume(period = "DAY")[18] + volume(period = "DAY")[19] + volume(period = "DAY")[20] + volume(period = "DAY")[21] + volume(period = "DAY")[22] + volume(period = "DAY")[23] + volume(period = "DAY")[24] + volume(period = "DAY")[25] + volume(period = "DAY")[26] + volume(period = "DAY")[27] + volume(period = "DAY")[28] + volume(period = "DAY")[29] + volume(period = "DAY")[30]) / 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

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.
 

Similar threads

Top