Is it vooddoo? Why is e-05 added at the end of some of my doubles? A search engine query didn't help.

 

This is weird. My Expert Advisor was working and 5 minutes later I couldn't make it work again.

Investigating led me to this issue. It seems like some numbers get corrupted, because NormalizeDouble() and other functions taking doubles as input will only output zero with them.

Note that I didn't touch the problematic function before it broke. And the little I changed I converted to comments to narrow down the problem.

 
 
kb4ski:

This is weird. My Expert Advisor was working and 5 minutes later I couldn't make it work again.

Investigating led me to this issue. It seems like some numbers get corrupted, because NormalizeDouble() and other functions taking doubles as input will only output zero with them.

Note that I didn't touch the problematic function before it broke. And the little I changed I converted to comments to narrow down the problem.

 

This is the so called exponential or E notation.
https://en.m.wikipedia.org/wiki/Scientific_notation

1E-5 equals 1 x 10‐⁵ = 0.00001
1E5 or 1E+5 equals 1 x 10⁵ = 100.000
 
tomm73:

This is the so called exponential or E notation.
https://en.m.wikipedia.org/wiki/Scientific_notation

1E-5 equals 1 x 10‐⁵ = 0.00001
1E5 or 1E+5 equals 1 x 10⁵ = 100.000

Thanks for your input. I just saw other threads about this notation on the forum, but in my case most of the problematic numbers don't have a leading 1.

Still wondering how the code could break suddenly without reason.
 
kb4ski how the code could break suddenly without reason.

It hasn't "broke without reason."  You just didn't notice it before. 1E-5 is less characters than 0.00001.

If you want to see the correct number of digits, convert it to a string with the correct/wanted accuracy.
          question about decima of marketinfo() - MQL4 programming forum
 
William Roeder:

It hasn't "broke without reason."  You just didn't notice it before.

I would have noticed if didn't work, but like I said it was working and BOOM, it stopped working out of nowhere 5 minutes later.

 
William Roeder:

 1E-5 is less characters than 0.00001.

By the way it is e-05, not 1E-5,
 
kb4ski:

Thanks for your input. I just saw other threads about this notation on the forum, but in my case most of the problematic numbers don't have a leading 1.

Still wondering how the code could break suddenly without reason.
The leading 1 is just an example. E-05 means "move  the comma 5  numbers to the left". 234.56 E-05 = 0.0023455 or 234.56 divided by 100000.
 
tomm73:
The leading 1 is just an example. E-05 means "move  the comma 5  numbers to the left". 234.56 E-05 = 0.0023455 or 234.56 divided by 100000.

Yes but why do other people on the forum get 1e-05? I just noticed that the results I was getting earlier when searching for "e-05" on this forum have disappeared. Who is messing with me again?

To be more precise, why for example would Ask - Bid return a number with the scientific notation?
 
Please guys don't give up.
 
kb4ski:
Please guys don't give up.
You realize that this is just another representation of an internally unchanged number? Doubles are stored binary. The way they are displayed for us humans to read does not change their content. 

I think you're looking for the problem in the wrong place. NormalizeDouble, for example, usually just hides another problem instead of fixing it. Look for it in the forum, there is a lot to read about it.

https://www.mql5.com/en/forum/135572#comment_3440868
 

I found something.

_Point and MarketInfo(_Symbol,MODE_POINT) are both = 1e-05 !?

Reason: