Scan ADX setup

How do I set up a scan that looks for stocks and ETFs where ADX is below BOTH +DI AND -DI lines for longer than, say, 4 weeks ? or basically for an extensive time period ? I am not sure how if this can be done. But any help is really appreciated. Thanks much.

I don't look for trading ranges, so I don't have one at hand. If you want to experiment, you might try something with price channels. Maybe something in a time frame longer than the range you are looking for. So, if you want a 3 month range, look for 6 month price channels getting narrower - you would test for the difference between upper and lower channel today less than the difference some time in the past.