After three weeks working properly, my EA returned wrong values for two hours, then it corrected it self. What happen?

 
double dailyPriceInfo[4];

void OnTick()
  {
   daily_price_info(dailyPriceInfo);
   
    Comment
         (                                     
            "Daily High            ", dailyPriceInfo[0],"\n",
            "Daily Low             ", dailyPriceInfo[1], "\n",
            "Daily Range          ", dailyPriceInfo[2], "\n",
            "Spread                 ", dailyPriceInfo[3])
  }

void daily_price_info(double& myArray[])
  {
   /* Return the current day price info such as daily high, low, range, and spread
   */
   
   // Create Mql Structure for the prices and copy bar info
   MqlRates barInfo[];
   CopyRates(_Symbol, PERIOD_D1, 0, 1, barInfo);
   // Sort array from the oldest to the most recent bar
   ArraySetAsSeries(barInfo, true);
   // Storing variables into a string
   dailyPriceInfo[0] = NormalizeDouble(barInfo[0].high, _Digits);
   dailyPriceInfo[1] = NormalizeDouble(barInfo[0].low, _Digits);
   dailyPriceInfo[2] = NormalizeDouble(barInfo[0].high - barInfo[0].low, _Digits);
   dailyPriceInfo[3] = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_ASK) - SymbolInfoDouble(_Symbol, SYMBOL_BID),  _Digits);
  }

Hello, my fellow traders,

I have been developing an EA for three weeks to print on my chart some basic info, such as the high, the low, and the range of the current day and the current spread. The algo was doing was it was supposed to do until today when something strange happens.

As I do every trading day, I turn both my desktop and my laptop on as well as the MT5’s @ 6:30 a.m., London time. Thus, I use 1 MT5 in the laptop and 2 MT5’s in the desktop to trade. The MT5 from the laptop and one of the MT5 from the desktop were downloaded from the MT5 official website and are used to access the asset quotes from the same broker, that we shall call broker A, while the other MT5 from the desktop was downloaded from a different broker website, broker B, and it used to access the asset quotes from broker B. Finally, the EA in question was generated from the same base code and the same executable file used in all three MT5 platforms.

As I stated before, everything was running fine until today. Once I started the MT5s I realized that my EA was showing wrong values of the high/low and range of the current day from broker A, both in the laptop and in the desktop. The same EA was returning correct values from broker B.

I triple checked the code; verified the daily candle information to cross-check the values. The Algo was returning completely wrong values. For instance, GBPUSD current (correct) high was 1.29656 while the algo was returning 1.29202. And, in consequence of that, the algo as returning a wrong daily range value.

This situation perdured for 2 straight hours, after GU dropped 130 pips, when, suddenly, the EA from broker A, in both MT5, started returning correct values (and it is returning correct values by the time I’m writing this post). I need to state here that I did not change anything in the code while this situation happens.

I am extremely intrigued (and worried) with what happened, and because of that, I am here to pledge the help from my friends to shed some light and help me explain what just happen.

This is a code issue? A Programming Language issue? Or a Broker issue?


 

 
totavios: This is a code issue? A Programming Language issue? Or a Broker issue?

Either a network problem to the broker or the broker's server(s) went down. So all you saw was the last tick data.

 
William Roeder:

Either a network problem to the broker or the broker's server(s) went down. So all you saw was the last tick data.

Thanks for the reply. I forgot to mention about that.

MT5 was connected to my broker the whole time and could not identify interruptions. bid/ask quotes were being transmitted all the time. Actualy, If you were looking only to the chart, you wouldn't notice a problem at all. The daily candle was showing the high @ 1.29656, but the algo was showing 1.29202. Thus, I traded while this event happened with no problem (ignoring the value from my EA, of course).

Reason: