Highest MA? How do you programme that?

I'm not getting anywhere at the moment and I think the solution is quite simple. If I want to compare five MAs and I want to define which one is the highest. What must the afl look like? Could you help me?

Put MAs into matrix and use mxSort

Set. nth = 2; to nth = 1;