@marvinm When you get the understanding it's not complicated, but not simple.
This is the logic:
check BB hi/low distance on a candle then add 1 to candle ID and check again
when this is no longer true the opposite is checked
the conditions then check when the distance is correct for enough candles and display tight or apart
if gap isn't big or small enough for enough candles the comment will say transferring