which order's open price is the lowest one - page 2

 
qjol:

my code didn't help


Thank qjol:

This new code still show me all the 3 OrderOpenPrices as below:

2010.11.02 05:45:17 MyEa GBPJPY,M5: value = 0.00000
2010.11.02 05:45:17 MyEa GBPJPY,M5: array value = 129.23600
2010.11.02 05:45:17 MyEa GBPJPY,M5: array value = 129.20700
2010.11.02 05:45:17 MyEa GBPJPY,M5: array value = 129.20300

 
WHRoeder:


Thank you very much WHRoeder, It works well.
 
jian:

Thank qjol:

This new code still show me all the 3 OrderOpenPrices as below:

2010.11.02 05:45:17 MyEa GBPJPY,M5: value = 0.00000
2010.11.02 05:45:17 MyEa GBPJPY,M5: array value = 129.23600
2010.11.02 05:45:17 MyEa GBPJPY,M5: array value = 129.20700
2010.11.02 05:45:17 MyEa GBPJPY,M5: array value = 129.20300

May this code helps ;

double LowestBuyPrice()

  {

   double Price=0;


   for(int order=0; order<=OrdersTotal()-1; order++)

      if(OrderSelect(order,SELECT_BY_POS))

         if(OrderType()==OP_BUY)

            if(OrderSymbol()==Symbol())

               if(Price==0)

                  Price=OrderOpenPrice();

   else

      if(Price!=0

         && MathMin(Price,OrderOpenPrice())==OrderOpenPrice())

         Price=OrderOpenPrice();

   else

      if(Price!=0

         && MathMin(Price,OrderOpenPrice())==Price)

         Price=Price;


   return(Price);

  }

Reason: