The "Mean Renko Bars" function looks suspicious. I would debug it.