I recommend you read William Roeder's comments on not using NormalizeDouble (and when you would actually want to normalize a double).
If you need a user-friendly way of outputting the double value to a GUI or user, use DoubleToString.
void barCalculations() { double barSize=MathAbs(Close[1]-Open[1]); Print(DoubleToString(barSize, Digits)); }
I did a side-by-side comparison of the way you did it before and the proper way to output a double to a user/gui (using DoubleToString). Here are two of the results I got. The left was with your method, the right was with DoubleToString.
![MT4:NormalizeDouble MT4:NormalizeDouble](https://c.mql5.com/36/52/mt4-normalizedouble.jpg)
- 2017.01.04
- www.mql5.com
thank you wery much for your reply. i will read the info.
NP and hope it could help 👍
Other things I recommend everyone read from William is when to use TickSize over Point and how to properly compare doubles.
The part about comparing doubles actually applies to every programming language. Here's one video (Java) that explains it in layman's term.
Note that the Epsilon for price will always be Point while the Epsilon for any other type of double is whatever accuracy you define.
![Point - Predefined Variables - MQL4 Reference Point - Predefined Variables - MQL4 Reference](https://c.mql5.com/36/52/point-predefined-variables-mql4.png)
- docs.mql4.com
👍 👍 👍
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
the value returning with errors in some cases (see picture)
please help and explain why if possible.