The problem with that logic is that you will search for a limited number of candles in the past. Is that what you need? If you select Cycle=5, the bot will only search for that range in the previous 5 candles only.