News EA- I am getting precision error -Any help appreciated

To add comments, please log in or register
Prabhufx
1046
Prabhufx  

All- one of my news EA, I am getting below error -

broker base time updated to a more precise time 


Below is the code and Any idea on how to fix this error?



  //------------------------------------------------------------------

  if (!IsConnected() || AccountNumber() == 0 || Bars <= 30 || ArraySize(Time) == 0) return;

  //------------------------------------------------------------------

  if (baseTime.time == 0)

  {

    baseTime.time = TimeCurrent();

    baseTime.ticks = GetTickCount();

  }

  else

  {

    if (TimeCurrent()-baseTime.time >= 10)

    {

      ulong newTicks = GetTickCount();

      if (ulong((TimeCurrent()-baseTime.time)*1000) < newTicks-baseTime.ticks)

      {

        baseTime.time = TimeCurrent(); baseTime.ticks = newTicks;

        if (Logging) Print("broker base time updated to a more precise time ("+TimeToStr(baseTime.time, TIME_DATE|TIME_SECONDS)+", "+IntegerToString(baseTime.ticks)+")");

        

        for (int i = 0; i < 4; i++)

          if (events[i].time > baseTime.time + 10)

            events[i].ticks = newTicks+(events[i].time-baseTime.time)*1000+ReadingInterval;

      }

    }

  }

Sergey Golubev
Moderator
106113
Sergey Golubev  

Forum on trading, automated trading systems and testing trading strategies

When you post code please use the CODE button (Alt-S)!

Use the CODE button

Thank you.

To add comments, please log in or register