Download MetaTrader 5
To add comments, please log in or register
Having questions to the author of an article? Discuss them on the Forum!
Neal_Van
301
Neal_Van 2016.05.13 22:19 

hello, I'm stuck on this code trying to get the results of open tickets but I get errors.

semicolon expected and unexpected end of program... 

int start()

{

for (int i=0; i<OrdersTotal();i++) 

{   // check all orders      

         if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) 

         {

            break; 

         }

         

         Print(OrderTicket(), " ", OrderSymbol(), " ", OrderOpenPrice())

         

}

return(0);

}


Marco vd Heijden
Moderator
4188
Marco vd Heijden 2016.05.13 22:32  
Neal_Van:

hello, I'm stuck on this code trying to get the results of open tickets but I get errors.

semicolon expected and unexpected end of program... 

int start()

{

for (int i=0; i<OrdersTotal();i++) 

{   // check all orders      

         if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) 

         {

            break; 

         }

         

         Print(OrderTicket(), " ", OrderSymbol(), " ", OrderOpenPrice())

         

}

return(0);

}


if you look after the error it will show you the line number and the position number.

int start()

{

for (int i=0; i<OrdersTotal();i++) 

{         // check all orders      

         if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) 

         {

            break; 

         }

         

         Print(OrderTicket(), " ", OrderSymbol(), " ", OrderOpenPrice());

         

}

return(0);

}
Neal_Van
301
Neal_Van 2016.05.13 23:06  
Marco vd Heijden:

if you look after the error it will show you the line number and the position number.

lol... i don't know what i was thinking.. sorry for posting.  i clearly see the error... 
Beijing Wangshunda Technology Co. Ltd.,
342
Xiaoyu Du 2016.05.15 11:57  
int Total;
Total=OrdersTotal();
for (int i=0; i<Total;i++) 
/
To add comments, please log in or register