Download MetaTrader 5

MQL4 bug

To add comments, please log in or register
Thousands of developers have already published their products in the Market. Join them!
Sasa Pucko
399
Sasa Pucko 2016.05.23 10:00 

// 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
3153
Ex Ovo Omnia 2016.05.23 10:31  
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
6591
Carl Schreiber 2016.05.23 11:15  
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
30740
Alain Verleyen 2016.05.23 12:19  
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
3331
Geldberg Geldstein 2016.05.23 13:33  
For prints, u must use DoubleToString. Don't foget about #property strict, this will help u.
Kazi Jakaria
1228
Kazi Jakaria 2016.05.23 15:41  
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
399
Sasa Pucko 2016.06.21 06:53  
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
30740
Alain Verleyen 2016.06.22 14:00  
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