I am interested in running a filter on volume, wherein let’s say volume over last 30 days is greater than 1 L shares for each day. Mind it is not average volume but each day volume is greater than 1 L
for( i = 0; i < BarCount; i++ )
{
Filter = Volume [i} > 100000;
}
If I’ve understood your question correctly then you want a filter that produces a true value if the volume has been greater than 100,000 in each of the past 30 periods. No need for using Loops.
You can use the Sum() function:
//Single Bar Volume > 100,000//
SBVF = Volume > 100000;
//Volume > 100000 for each of past 30 days//
VFilt = Sum(SBVF,30) == 30;