Latest MT4 update 1421 has a very SERIOUS BUG!!! - page 5

 

Guys who can reproduce the incorrect work of MathRound, please run this advisor and show the result.

I want to add a MathRound check to my EAs and I want to make sure that my function returns false if MathRound doesn't work correctly. I'm just not sure I was able to avoid compiler optimizations.

(The code is cross-platform)

#property strict

int OnInit()
  {
   if(!checkMathRound())
      return(INIT_FAILED);
   Alert("Initialization successful");
   return(INIT_SUCCEEDED);
  }

void OnTick() { ExpertRemove(); }

bool checkMathRound()
  {
   MathSrand(GetTickCount());
   double x = (MathRand() % 4) / 10.0 + 1.1;
   double rounded = MathRound(x);
   if(rounded == 1.0)
      return(true);
   Alert(StringFormat("MathRound doesn't work correctly. MathRound(%f) = %f", x, rounded));
   return(false);
  }
[Edited to combine 2 posts into one]
 
Vladislav Boyko #:

Guys who can reproduce the incorrect work of MathRound, please run this advisor and show the result.

I want to add a MathRound check to my EAs and I want to make sure that my function returns false if MathRound doesn't work correctly. I'm just not sure I was able to avoid compiler optimizations.

(The code is cross-platform)

You are off-topic.
 
Alain Verleyen #:
You are off-topic.

I'm talking about the MathRound bug, which is the subject of this thread.

At the moment, the only way to avoid this bug is to not run the advisor/indicator on computers where it occurs. That's what I'm trying to do, but I can't reproduce the bug on my end.

But you can delete my posts if you want.