Please help me create a Scanner

I have attached the jk paper daily chart I want to create a screener which can filter stocks where daily prices have been in a channel for 1 or 2 weeks

You can refer to the above scanner, I have created the conditions to fetch stocks that are in a 5 % channel range from the last 20 candles, you can change the % as per your requirement.

You can also change the candle range as per your requirement. I have used the period min and period max function to create the conditions. Refer to the below links to learn more about these functions-