Why not use 2 MAs of shorter duration: one on the highs and another on the lows? That would eliminate the errors at the crossover.