Highly corrector stock help - AFL code

#1
Can anybody help sharing an AFL Code reference for the below criteria (for EOD data, not intraday):
(i) Candlestick bars count should be <=5 (only these many candlesticks will be taken)
(ii) High and Low difference % (of the <=5 candles) should be between >12% and <20%, indicates nicely corrected stock (this is for choosing stocks which are about to reverse higher)
Thanks in advance..