Questions from Beginners MQL5 MT5 MetaTrader 5 - page 474
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
That's not all... https://www.mql5.com/ru/forum/66827
How do I know the real value of a variable of type double? The thing is, sometimes thousands of digits are thrown out via print - the variable itself is formed from a text string, but it goes through a rounding procedure.
Ahem. What do you need it for?
To detect an error in the calculation :)
Do you want to compare several values of type double?
Can you please send e-mail messages from the Metatrader 4 terminal in such a way that a screenshot of the current chart is taken and put in the middle of the message. Example:
There was a buy signal on EurUsd
<скриншот09122015_eurusd.png>
Additional information about the opening.
Tell me how to implement this? Maybe there is an example or something similar that can be redone. Thanks!Not quite... there is an assumption that numbers do not always have an integer value of 4=3.99999999999999999 and after doing the math, you get an inaccuracy after rounding.
Even if inaccuracy appears, use NormalizeDouble(). Set the accuracy you want for your calculations. This is what this function is for.
The example there seems to describe your case:
You should be aware that the normalised number when output to the Journal using Print() may contain more decimal places than you expect. For example,
DoubleToString(a,8)=76.67100000
Print(76.671)=76.67100000000001
Even if inaccuracy appears, use NormalizeDouble(). Set the accuracy you want for your calculations. This is what this function is for.
The example there seems to describe your case:
Yes - it is described, yes - I use it - the question is how not through Print and string in general to get data for analysis :)
Using the same NormalizeDouble(). You get a number of type double. Normalized. Simply Print() outputs it like this.
Here it is written how to do the comparison correctly: https://www.mql5.com/ru/docs/basis/types/double