iClose(), iTime(), CopyRates() etc. takes seconds and crashes EA and MT5 - page 3

 
Up ... still an issue!
 

Forum on trading, automated trading systems and testing trading strategies

Asynchronous loading of charts - does MetaQuotes really know how many problems this creates?

Doerk Hilger, 2020.05.28 17:37

Yes I think this would be the best method. But as mentioned, it happens rarely and it seems that it happens on specific dates, cause it´s like that, that I do not hear nothing from any client for a while, but then there are several clients within 2-3 days. It does not necessarily mean, that it does not happen every day at someones computer. This timing could be broker-server related, actually I can only guess here, but in fact its not a broker-server problem, we checked this simultaneously of course couple of times when there were more problems as usual. It seem to happen locally. 

I start a test on 20 charts, set with 1000 bars max, build 2470, Metaquotes-Demo server. I can let this test run as much time as needed.

If needed I can run it on an other broker or more charts.

 
Thx for you effort. I mentioned somewhere earlier that I am not sure if this happens with demo accounts as well. Maybe it makes sense that I give you a new hint when there are some new mails in the support mailbox, which could be caused by this issue. Currently its totally quiet. 
 
Doerk Hilger:
Thx for you effort. I mentioned somewhere earlier that I am not sure if this happens with demo accounts as well. Maybe it makes sense that I give you a new hint when there are some new mails in the support mailbox, which could be caused by this issue. Currently its totally quiet. 
Ok, I will run it on a live account, not a problem.
 
Alain Verleyen:
Ok, I will run it on a live account, not a problem.
After 10 days running it on a live account, nothing happened, I gave up. There is obviously something else at work to reproduce the problem.
 
Alain Verleyen:
After 10 days running it on a live account, nothing happened, I gave up. There is obviously something else at work to reproduce the problem.

Thank you for your effort. I also had no such issues at the support desk since we started this conversation. 

 

This is the same bug I meet when I test the data of a lot of symbols in my routine placed in a OnTimer call.


void OnTimer()
{
   int iSymbols = SymbolsTotal(true);

    for(int i = 0; i<iSymbols; i++)
    {
      string sSymbol = SymbolName(i,true);
      
      if(TF_M15 == true)SearchSignal(sSymbol,PERIOD_M15);
      if(TF_M30 == true)SearchSignal(sSymbol,PERIOD_M30);
      if(TF_H1 == true)SearchSignal(sSymbol,PERIOD_H1);
      if(TF_H4 == true)SearchSignal(sSymbol,PERIOD_H4);
      if(TF_Daily == true)SearchSignal(sSymbol,PERIOD_D1);
         
    }

}

//+------------------------------------------------------------------+
void SearchSignal(string Sym, ENUM_TIMEFRAMES TimeFrame)
{


double  dOpen1 = iOpen(Sym,TimeFrame,1);
double dClose1 = iClose(Sym,TimeFrame,1);
datetime   dt0 = iTime(Sym,TimeFrame,0);

if(dOpen1==0){iHistoryBugs++;return;}
if(dClose1==0){iHistoryBugs++;return;}
if(dt0==0){iHistoryBugs++;return;}

double dCandle = dHigh1 - dLow1;

if(dCandle==0)return;

Print("Candle: " + (string)dCandle);

}


In random case during calls to iClose or iOpen function the sytem freeze and waits for a long. long time!

In Debugging mode I saw that the data returned is zero but you understand that is not right wait for a such long time. I would prefer set a query timeout value so that I can jump over the problematic symbols.

Reason: