[Bug] - ChartFirst() and ChartNext() problem for symbol not available

 

Hello,

I've found a bug in ChartFirts(), and ChartNext() functions when you try to go through all charts of the client's terminal (opened ones).

Let's suppose you connect to broker A which is a FOREX broker, open EURUSD chart, and then connect to broker B, which is an Exchange Broker.

On broker B, EURUSD chart will become unavailable and will show "Waiting For Update", so far, it's okay.

But if you try to run the code below, ChartFirts() and ChartNext() will never return some value.

long ch=ChartFirst();
   while(ch!=-1)
      {
      Print(ChartSymbol(ch));
      ch=ChartNext(ch);
      }

ChartFirt() never return if the first chart is the one which is unavailable on the Broker side.

ChartNext() never return if the chart which is unavailable on the Broker side is not the first one.

Tests were done in MT5 build 2340

It seems these functions gets into an endless loop internally and never return the expected values possible.

Best regards.