AFL code to find stock swhich are in uptrend or downtrend

#1
Dear All,
I am looking for AFL code which will scan through the list of stocks and identify which stocks are in continuous uptrend or downtrend for 7 or more number of days. If the days are selectable, that will be more helpful.

For example, I want to find which are the stocks that are having up-close continuously for 7 days or vice versa.

What I want to do is to run exploration functionality of Amibroker, identify stocks that have high possibility of pullbacks.

I searched quite a bit in the web, but cannot find a program that do this. I want to run this of daily and weekly bars.

Can anyone help me on this?