I have been learning the MQL4 programming lingo but came stuck at the MACD. The iMACD function, I know gets some stick, but its main problem for me is the values it returns. It will round everything up or down making values flatline when really the histogram is moving up… 0.00037 becomes 0.0004 and 0.00042 becomes 0.0004… Two very different values. Can anyone help with a solution?
I have tried using custom indicators but can’t seem to get them to work. If anyone can lend a hand here, I would much appreciate it. Any help welcome
The problem isn’t with MT4, its your code. All double values have 16 digits of precision, but of course you only want to look at no more than 5. I don’t know how you displaying the values, but try something lkieDoubleToStr(MACDval, Digits) and that should work unless you are trying something else.