Close order next tick - page 2

 
kot_filemon: Here is the code from MT4 platform (built in). I don't have OrderSymbol().
 for(int i=0;i<OrdersTotal();i++)
     {
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false)        break;
      if(OrderMagicNumber()!=MAGICMA || OrderSymbol()!=Symbol()) continue;
  1. You don't?
  2. You MUST count down Loops and Closing or Deleting Orders - MQL4 forum
 
I'd like to know, but error is: 0Print Screen of errors
 
kot_filemon:
I'd like to know, but error is: 0
Why are you printing/Alerting the error if there is none ? please read the Thread I gave a link to . . . check the return value from the OrderSend(), OrderModify(), OrderClose() etc. if the return value tells you that the operation failed then print the error.

If the orders are being closed before you think they should be closed print the variables that you use to decide to close or not close and see if they are what you expect . . .