Finding the most distant opened order

 
If there is a live order pool with 100 orders, 50 are short, 50 are long. How is it possible to find the most distant opened order? If analyzing the 50 short orders, which order has the smallest open price. If analyzing 50 long orders, which order has the largest open price. I was thinking of setting up an array of [number of orders x 2], [50 2].
 
c0d3:
If there is a live order pool with 100 orders, 50 are short, 50 are long. How is it possible to find the most distant opened order? If analyzing the 50 short orders, which order has the smallest open price. If analyzing 50 long orders, which order has the largest open price. I was thinking of setting up an array of [number of orders x 2], [50 2].

Run through the OrderSelect() loop using OrderOpenTime() and OrderOpenPrice() ?