Filmon Daniels:
I am using the macd via iCustom and I am getting values like -9.163163680847575e-05 which actually is equivalent to -0.00009163 using DoubleToStr.
Among other operations I need to check if it is greater than / less than 0. It's been a bit of a struggle.
You happen to be getting values near zero.
Why is if(v > 0) a struggle? You have confused yourself.
Only if you are comparing prices and equality is important do you need extra care.
I think I might have. I am unable to recreate and, with added logging, proved that this is not an issue. The issue is probably with comparing between two non-zero doubles. I will read through code and forums again and debug. Thank you for your response.

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
Hi,
I have read a few threads regarding handling doubles and I can't say I understand. Please find the following links
article on working with doubles - https://www.mql5.com/en/articles/1561
a similar issue - https://www.mql5.com/en/forum/155049
why i shouldn't use NormalizeDouble - https://www.mql5.com/en/forum/137301
the == operand - https://www.mql5.com/en/forum/145258
a valuable thread on this issue - https://www.mql5.com/en/forum/136997
using alternative double comparators - https://www.mql5.com/en/forum/139140 & https://www.mql5.com/en/forum/118953#comment_3150582
I am using the macd via iCustom and I am getting values like -9.163163680847575e-05 which actually is equivalent to -0.00009163 using DoubleToStr.
Among other operations I need to check if it is greater than / less than 0. It's been a bit of a struggle. I haven't had much success with DoubleToStr as it converts it into a string. I would like to get the string value as a double and understand the limitations of the primitive type in mql4. Also have read about dlls and trying to use c++ libs for transformation and better precision but had no success in any of the above.
Another issue cut from a similar cloth is when you get these kind of values and using typical gt/lt it somehow returns true i.e. 0.000002341341 is less than 0
I feel like all the clues are there but i'm blind to it, can anyone help.
Any help is appreciated
some code so i dont get bollocked