Thanks for that script! It should work well for trading with Renko bars, only in the chart they are of course plotted with different width because the x axis is based on price bars, not on renko bars.

I do not believe that a profitable system is possible with Renko or similar artificial bars. But if you nevertheless want to pursue that further, we can implement a Zorro function for building price bars in a user defined way. Renko bars will then be plotted correctly and your above script will become somewhat simpler. Of course this method has many limitations, for instance you can have only one asset - portfolio trading is not possible. But let me know if you still want to continue with Renko research and we'll implement that.