i got two orders

 

my code is like this :

start()

{

.........

if(orderstotal()==0) ordersend(.......)

..............................................

return(0) ;

}

i got two orders . i want to know how long will the sever return the new accout statates after it changes .

 
Doesn't it depend on when the next tick arrives ?
 
i think i may be because,when an order was opened,the sever have not react in time,then the next tick comes,and orderstotal is still zero .
 

YALEWANG:

start(){ .........

if(orderstotal()==0) ordersend(.......)

..............................................

return(0) ;

}

i got two orders . i want to know how long will the sever return the new accout statates after it changes .


  1. if(orderstotal()==0) means the EA is incompatible with ever other including itself and manual trading.
    int count=0;
        for(int iPos = OrdersTotal()-1; iPos >= 0; iPos--)
         if(OrderSelect(iPos, SELECT_BY_POS)                    // Only my orders w/
        )if(OrderMagicNumber()  == magic.number                 // my magic number
        )if(OrderSymbol()       == chart.symbol                 // and my pair.
        ){  count++; }
    if (count == 0) ...
    
  2. Everything has been update once OrderSend(), returns (except Bid/Ask)
Reason: