Download MetaTrader 5

MQL4 bug

To add comments, please log in or register
Sasa Pucko
400
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

Ex Ovo Omnia
3316
Ex Ovo Omnia  
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.
Carl Schreiber
7240
Carl Schreiber  
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
Alain Verleyen
Moderator
32842
Alain Verleyen  
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".

Geldberg Geldstein
3237
Geldberg Geldstein  
For prints, u must use DoubleToString. Don't foget about #property strict, this will help u.
Kazi Jakaria
1323
Kazi Jakaria  
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?
Sasa Pucko
400
Sasa Pucko  
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
Alain Verleyen
Moderator
32842
Alain Verleyen  
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.

To add comments, please log in or register