I need an afl that I can explorer or scan my stocks, that gives me the stocks that have an average volume greater than 100.000 in the last 30 days/bars. I would like to be able to change the variable volume and days.
Could someone help me an write the afl code? I appreciate a lot.
Please note that I am new to programming AB so caveat emptor.
Try this for parameter setting. If you want to change the parameters before the scan then go to the parameters icon in the analysis window and adjust, also make sure the scan is set for daily.
Filter = 1;
Days=Param("Days",30,5,200);// can adjust days between 5 and 200, default 30 days
vpara=Param("AvgVol",100000,50000,1000000);//can adjust volume levels from 50,000 to 1,000,000, default 100,000
limitVolume = MA( V, Days ) > vpara;
AddColumn( limitVolume, "limitVolume" );
AddColumn(MA(V,Days),"AvgVol");//this will show whether volume is above the average or not