I am trying to write scans for QP2 that will produce four groups of stocks:
1. stocks that are trending 2. stocks that are in a trading range 3. stocks that are volatile (large price and/or volume swings 4. stocks that are calm (small price and/or volume swings
I'd like to use these groups to compare how indicators perform in different trading environments.
I've tried writing these on my own but I'd not getting the right results. For example, I wrote this to get a list of trending stocks:
output ="trending.lst";
if (close (0) >=5) and (close (0) > wmovavg (0, 7, cl)) and (wmovavg (0,7,cl) > wmovavg (-1,21,cl)) and (wmovavg (0,21,cl) > wmovavg (0,200,cl)) and (wmovavg (0,200,cl) > wmovavg (0,400,cl)) and (movavg (0,400,cl) > movavg (-400,400,cl)) then println symbol,",",description; endif;
When I ran this scan it produced a hodge podge list of stocks with only a few "trenders." I don't know why this didn't work.
I'd appreciate any help/advise in writing these scans.
Thanks
|