MQL4 bug

 

// NormalizeDouble function returns negative value if argument is big double number!

int OnInit()

{
   double var=DBL_MAX, var1=NormalizeDouble(var,2);
   Print("var=",var," var1=",var1);
   ExpertRemove();
   return(INIT_SUCCEEDED);
}


//returns   var=1.797693134862316e+308 var1=-9.223372036854776e+016

 
Sasa Pucko:

// NormalizeDouble function returns negative value if argument is big double number!

int OnInit()

{
   double var=DBL_MAX, var1=NormalizeDouble(var,2);
   Print("var=",var," var1=",var1);
   ExpertRemove();
   return(INIT_SUCCEEDED);
}


//returns   var=1.797693134862316e+308 var1=-9.223372036854776e+016

Who cares of numbers, which do not have decimal places (>2^52), but you may report it.
 
Sasa Pucko:

// NormalizeDouble function returns negative value if argument is big double number!

int OnInit()

{
   double var=DBL_MAX, var1=NormalizeDouble(var,2);
   Print("var=",var," var1=",var1);
   ExpertRemove();
   return(INIT_SUCCEEDED);
}


//returns   var=1.797693134862316e+308 var1=-9.223372036854776e+016

Do not use NormalizeDouble() at all! See here or here
Trailing Bar Entry EA (Ben Linus) - MQL4 forum
Trailing Bar Entry EA (Ben Linus) - MQL4 forum
  • www.mql5.com
Trailing Bar Entry EA (Ben Linus) - MQL4 forum
 
Carl Schreiber:
Do not use NormalizeDouble() at all! See here or here

There is no problem to use NormalizeDouble(), if you are using it correctly.

Please don't come here with "coding propaganda".

 
For prints, u must use DoubleToString. Don't foget about #property strict, this will help u.
 
Sasa Pucko:

// NormalizeDouble function returns negative value if argument is big double number!

int OnInit()

{
   double var=DBL_MAX, var1=NormalizeDouble(var,2);
   Print("var=",var," var1=",var1);
   ExpertRemove();
   return(INIT_SUCCEEDED);
}


//returns   var=1.797693134862316e+308 var1=-9.223372036854776e+016

I never found any bug. its seems a ea bug?
 
Alain Verleyen:

There is no problem to use NormalizeDouble(), if you are using it correctly.

Please don't come here with "coding propaganda".

Alain, it seems you getting your moneys from other people trauma, there is no propaganda, its just bug,.. and i jus twant to help others, as you do not want to
 
Sasa Pucko:
Alain, it seems you getting your moneys from other people trauma, there is no propaganda, its just bug,.. and i jus twant to help others, as you do not want to

???

I was not answering to you but to Carl, and he knows perfectly what I am talking about.

About your initial post, yes it's a bug, but nobody cares as it makes no sense to use NormalizeDouble on such big numbers as reported by Ovo.

About your last message, you should thing better about what you write to people you don't know, that's just incredible to answer such aggressive things.

Reason: