Please note that when output to Journal using the Print() function, a normalized number may contain a greater number of decimal places than you expect. For example, for:
double a=76.671; // A normalized number with three decimal places
|
you will have the following in the terminal:
DoubleToString(a,8)=76.67100000 Print(76.671)=76.67100000000001 |

- www.mql5.com
Please note that when output to Journal using the Print() function, a normalized number may contain a greater number of decimal places than you expect. For example, for:
double a=76.671; // A normalized number with three decimal places
|
you will have the following in the terminal:
DoubleToString(a,8)=76.67100000 Print(76.671)=76.67100000000001 |
Hi.
check this post. I had the same problem.
https://www.mql5.com/en/forum/65621
You can fix it by using this method:
DoubleToString(NormalizeDouble(dYourVariable,2), 2);

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, first of all i have trouble to post on mq4 forum so i write here ... should be same anyways i found a bug.
(Test 1)
double blue_0 = NormalizeDouble(iMA(NULL, 60, 5, 0, MODE_LWMA, PRICE_CLOSE, 0), Digits);
Print("first:",NormalizeDouble(blue_0 +(10 * Point), (int)MarketInfo(NULL, MODE_DIGITS)));
Print("sec",NormalizeDouble(Ask, (int)MarketInfo(NULL, MODE_DIGITS)));
(Test 2)
double blue_0 = NormalizeDouble(iMA(NULL, 60, 5, 0, MODE_LWMA, PRICE_CLOSE, 0), Digits);
Print("first:",NormalizeDouble(blue_0 +(10 * Point), Digits));
Print("sec",NormalizeDouble(Ask, Digits));
here is the problem boys : http://oi65.tinypic.com/301ocox.jpg
somehow it gives abnormal digits from time to time ... happens not often but on many pairs you see it when u look for a minute on the expert window.
can anyone tell me how is that possible ? is it the Digits bugged or MarketInfo or Ask or iMA gives wrong digits ?
i hope someone can clear me out. a direct developer would be appreciated.