I tried to port AllPivots to mql5 but it doesn't work. I attach it, if you want to try someone to correct it.