You are awesome, thank you! It works perfectly in the normal MT5 chart but has problems in the Renko chart in Mt5, but this has nothing to do with the indicator, but probably how the Renko indicator processes the data. I will have a look at this and possibly try a new renko chart builder.
MT4: MT5: