Im using this gap screener to get access the daily gap ups/downs, and trade them 30 minutes after the market opens. Therefore I need the list of stocks sorted between 0-100 %, in that way where 0 is the most prioritized. “Priority”in the code below gives how many % the close is from either the low or high (whichever of the two has the shortest distance) of the 09:00 – 09:30 candlestick.
It doesnt work as intended, some stocks sometimes show priority=0 when the high != close for example. Can you see my mistake?