Errors, bugs, questions - page 2821
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
normalisation is not rounding
I have an A+ in theory, how to work with double and so on. The NormalizeDouble algorithm contains an error. The topic raised is only indirectly related to comparing doubles.
I repeat my question.
The picture shows the value of the non-normalised variable n and the normalised variable m and how different they are. But if you want to compare thongs, that's your preference.
I know the theory, how to work with double and stuff like that on an A+ scale. The NormalizeDouble algorithm contains an error. The topic raised is only indirectly related to comparing doubles.
The NormalizeDouble algorithm contains an error.
yes
I think A100 wrote about it
but developers since MQL have been sticking to this "feature", alas
If they correct it, the error will disappear.
I think other bugs will appear and there will be a lot of noise ))))
They won't, because almost everyone compares even normalised dubs through normalisation. I.e. they put it wherever they want.
Proper normalization should always give true in this condition.
Forum on trading, automated trading systems & strategy testing
Errors, bugs, questions
fxsaber, 2020.08.10 11:37
This is the only valid check for normalization. If it will always give out true, then nothing will break.
NormalizeDouble is just a certain algorithm that applies to a double number. Unfortunately, there is an error in it. If corrected, the error will disappear. All the other double-representations will not change as a result.
I think it's not about the function, but that the constants are not normalized by the compiler (although they should be).
Then the same constants in DLL and MQL will not match.
Then the same constants in DLL and MQL will not match.
Also true. Besides, any normalization is a loss of accuracy, so I may be overdoing it with constant normalization.
Just tweak the current normalisation algorithm.
Just tweak the current normalisation algorithm.
I don't even know if this is a bug in the algorithm.
Only rounding is not done by round(), ceil(), floor() as they also return double.Really, you can't compare doubles. Just a hard rule.
Or, as Slava says, through epsilon or through multiplication (e.g. by 1/_Point) with conversion to int with rounding.
Or through these, especially since they work faster than the regular ones:
Easier and faster, of course, through epsilon: