Order Price Open = 0.

 

Hey all.


Can't seem to understand why my code doesn't work, anyone can help me see what am i doing wrong?


void OnTick()
  {
//---

double op;
   if(OrdersTotal() >= 1)
     {
      int orders = OrdersTotal();

      for(int i=0; i<=orders-1; i++)
        {
         op = OrderGetDouble(ORDER_PRICE_OPEN);
         Comment(op);
        }
     }
  }
   


op is always equal to 0.0 and i have a limit order open (buy or sell, doesn't matter).


Thanks for the help :D

 
if (OrderGetTicket(i))
{
  op = OrderGetDouble(ORDER_PRICE_OPEN);
  Comment(op);  
}
 
matheus: op is always equal to 0.0 a

That is not MT4 code, but you posted in the MQL4 section, (bottom of the Root page).

 
I will move this topic to the EA section as it is not related to MQL4
Reason: