ranking calculations MQL4


I have a calculation for finding the Price from MA100 and MA50 shown in the formula below. How do i, 1; find all the price points where this has happened so that i can indicate on screen and 2; if MA100-MA50, how do i rank the last three prices from the subtracted difference? 

  for(int i = 0; i <= ARRAY_SIZE; i++)
      if(MathAbs(MA100- MA50) <= 0.001)
         // Get the price at index i + 1 and store it in the Price variable
         double price = Close[i + 1];