iMACD returning different value in code then frontend

 

Hi all,

I am using MACD indicator in MQL4. The issue I am facing is macd showing different value on mouseover but in code it is giving different value. Please refer to the blow snapshot  for value  of histogram and highlighted value printed via code.

macd

4.8766603758299e-05

 
salirazataqvi:

Hi all,

I am using MACD indicator in MQL4. The issue I am facing is macd showing different value on mouseover but in code it is giving different value. Please refer to the blow snapshot  for value  of histogram and highlighted value printed via code.


4.8766603758299e-05

Actually it's the same value. Scientific notation on one side, and rounded to 6th decimal other side.
 

Hi,

4.87e-05  is equal to 0.000049 but it's too big to be displayed correctly.

use NormalizeDouble  with the number of digits that you want to display.

 
  1. salirazataqvi: I am using MACD indicator in MQL4.
    Why did you post your MT4 question in the Root / MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. Mounir Cheikh: use NormalizeDouble  with the number of digits that you want to display.
    Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong
Reason: