Waiting for a new tick +Trade timeout

 

Hi everyone,

Recently,sometimes when my EA sends a request for an order,I receive the following errors:

2012.11.13 13:00:26    AUDUSD,M15: Alert: AUDUSD Opening order Sell...

2012.11.13 13:00:26    AUDUSD,M15: Alert: No prices. Waiting for a new tick..

2012.11.13 13:00:26    AUDUSD,M15: Alert: Retrying Selling...

2012.11.13 13:03:44    AUDUSD,M15: Alert: No prices. Waiting for a new tick..

2012.11.13 13:03:44    AUDUSD,M15: Alert: Retrying Selling...

2012.11.13 13:03:44    AUDUSD,M15: Alert: AUDUSD Opening order Sell...

2012.11.13 13:07:04    AUDUSD,M15: Alert: Error occurred: 128 (Trade timeout)

Although it says, "no prices, waiting for a new tick", the prices on the chart are being updated constantly and I can see that by the movement of price point.

Anyone knows why this happens?

 
angieFX:

Hi everyone,

Recently,sometimes when my EA sends a request for an order,I receive the following errors:

2012.11.13 13:00:26    AUDUSD,M15: Alert: AUDUSD Opening order Sell...

2012.11.13 13:00:26    AUDUSD,M15: Alert: No prices. Waiting for a new tick..

2012.11.13 13:00:26    AUDUSD,M15: Alert: Retrying Selling...

2012.11.13 13:03:44    AUDUSD,M15: Alert: No prices. Waiting for a new tick..

2012.11.13 13:03:44    AUDUSD,M15: Alert: Retrying Selling...

2012.11.13 13:03:44    AUDUSD,M15: Alert: AUDUSD Opening order Sell...

2012.11.13 13:07:04    AUDUSD,M15: Alert: Error occurred: 128 (Trade timeout)

Although it says, "no prices, waiting for a new tick", the prices on the chart are being updated constantly and I can see that by the movement of price point.

Anyone knows why this happens?

Try a bigger slippage, and test it with other broker MT, see if you have the same problem.
 
angieFX: Anyone knows why this happens?
  1. There are no mind readers here. With out the code we can only guess.
  2. "No prices, waiting for a new tick" is coming from the EA. The chart being updated has nothing to do with the message. Post the code. My guess is it's calling ArrayCopyRates in start instead of once in init.
        // https://www.mql5.com/en/forum/129734/page2 says ArrayCopyRates is a non-reentrant,
        // non-thread-safe call. There you must put a mutex around the call in case
        // of multiple EAs on multiple charts. Alteratively, since init() is single
        // threaded across all charts, put all ACRs here.
    

  3. "Retrying Selling" why is it retrying a orderSend when it has no prices. Post the code. If it is using ACR the number of bars is ArrayRange(acrArray,0) not ArraySize (# elements.)

  4. Trade timeout means the server did not respond to the trade request. Has nothing to do with slippage. You have no idea wither the order opened or not. When you get a new tick, the orderSelect loop will tell you. If you get this often, it's likely a broker problem. Occasional, a network problem.

 
WHRoeder:
  1. There are no mind readers here. With out the code we can only guess.
  2. "No prices, waiting for a new tick" is coming from the EA. The chart being updated has nothing to do with the message. Post the code. My guess is it's calling ArrayCopyRates in start instead of once in init.
  3. "Retrying Selling" why is it retrying a orderSend when it has no prices. Post the code. If it is using ACR the number of bars is ArrayRange(acrArray,0) not ArraySize (# elements.)

  4. Trade timeout means the server did not respond to the trade request. Has nothing to do with slippage. You have no idea wither the order opened or not. When you get a new tick, the orderSelect loop will tell you. If you get this often, it's likely a broker problem. Occasional, a network problem.

Thanks WHRoeder for your reply.Regarding your comments:

2.I'm not using ArrayCopyRates.

3.It retries buying/selling when a new tick arrives (See case 136 in the error function called Fun_Error below).

4.I determine if the order is opened or not using the ticket returned by OrderSend. If <0, the order didn't go through. If >0, order was opened.

This didn't happen often before, but during the last 24 hours, three of my orders didn't go through due to same errors. Before that, the same code worked fine in opening orders.

The block below is my code for opening orders:

while (true){
 if (buy_watch==1)  {//Buy trigger     
         Alert (Symb," Opening order Buy...");
         RefreshRates();
         SL_buy=Ask-Stop_Loss*Point*10;
         ticket_buy=OrderSend(Symb,OP_BUY,Lots,Ask,slippage,0,0,NULL,0,0,Blue);

         if (Fun_Error(GetLastError())==1){ // Processing errors for opening order buy
            Alert (Symb," Opening order Buy,Retrying...");
            continue;} // Retrying

         if (ticket_buy> 0) { // Success 
            buy_watch=0;
            Alert(Symb," Bought");
            Bought=1;
            buy_modify_bool=OrderModify(ticket_buy,0,SL_buy,nextres,0,Blue); 

            if (buy_modify_bool==true){
                  Alert(Symb," SL:",SL_buy," TP:",nextres);
                  SendNotification("SL & TP Set"+Symb);}
            else{
               Fun_Error(GetLastError());
               Alert (Symb,",Order N"+ticket_buy,":Unable to modify");
            }
                
            return; // Exit start()
         }//end of buy success

         return; // Exit start()     
      }//end of buy trigger
    break;//exiting while loop for opening orders
 }//end while loop for opening orders

This block here is the function for processing orders:

int Fun_Error(int Error) // Function of processing errors
{
switch(Error)
{ // Not crucial errors
      case 4: Alert("Trade server is busy. Trying once again..");
         Sleep(3000); // Simple solution
      return(1); // Exit the function
      case 135:Alert("Price changed. Trying once again..");
         RefreshRates(); // Refresh rates
         return(1); // Exit the function
      case 136:Alert("No prices. Waiting for a new tick..");
         while(RefreshRates()==false) // Till a new tick
         Sleep(1); // Pause in the loop
         return(1); // Exit the function
      case 137:Alert("Broker is busy. Trying once again..");
         Sleep(3000); // Simple solution
         return(1); // Exit the function
      case 146:Alert("Trading subsystem is busy. Trying once again..");
         Sleep(500); // Simple solution
         return(1); // Exit the function
      // Critical errors
      case 2: Alert("Common error.");
         return(0); // Exit the function
      case 5: Alert("Old terminal version.");
         Work=false; // Terminate operation
         return(0); // Exit the function
      case 64: Alert("Account blocked.");
         Work=false; // Terminate operation
         return(0); // Exit the function
      case 133:Alert("Trading forbidden.");
         return(0); // Exit the function
      case 134:Alert("Not enough money to execute operation.");
         return(0); // Exit the function
      default: Alert("Error occurred: ",Error); // Other variants
         return(0); // Exit the function
      }
}

Thanks again for you help.

Angie

 
trying my EA, i attached it to chart . instead of working, i have waiting for tick. what does waiting for tick mean? how can i solve that problem? thank you
 
Me too got the same problem: after set up EA, The message shows on chart as "waiting a tick". Does it mean the settings are correct and EA is working? How come no trades are placed 4 days after EA has been set up? Is there Anyone that can help explain what's going on?
 
colinchong1971:
Me too got the same problem: after set up EA, The message shows on chart as "waiting a tick". Does it mean the settings are correct and EA is working? How come no trades are placed 4 days after EA has been set up? Is there Anyone that can help explain what's going on?

Since "waiting a tick" is not a standard mt4 error message, you're left with 4 choices:

  1. Try the same setup on another account with another broker.
  2. Post your code, and somebody will likely help you check.
  3. Ask the author of the EA, if you didn't write it yourself.
  4. Engage somebody to help u code a similar EA, without that error. This will work IF you know the logic within the EA.
 
Seng Joo Thio:

Since "waiting a tick" is not a standard mt4 error message, you're left with 4 choices:

  1. Try the same setup on another account with another broker.
  2. Post your code, and somebody will likely help you check.
  3. Ask the author of the EA, if you didn't write it yourself.
  4. Engage somebody to help u code a similar EA, without that error. This will work IF you know the logic within the EA.
 
colinchong1971:
I see. Will ask the EA author about this issue then. Thanks!