MT4 not having the same numbers in indicators

 

Hey, I'm trying to use the MACD in MT4 but for some reason, the numbers in MT4 are not the same as with TradingView or other charting software. I see this more in the lower time frames such as 5 mins. My question is what MT4/MQL4 uses for sig figs? Or how does the ema/sma calculation get calculated in MT4/MQL4?

Thanks for the help!

 
Ron N.:

Hey, I'm trying to use the MACD in MT4 but for some reason, the numbers in MT4 are not the same as with TradingView or other charting software. I see this more in the lower time frames such as 5 mins. My question is what MT4/MQL4 uses for sig figs? Or how does the ema/sma calculation get calculated in MT4/MQL4?

Thanks for the help!

What are sig figs?

Calculations should be the same, but there may be differences due to price data and broker times.

 
Keith Watford:

What are sig figs?

Calculations should be the same, but there may be differences due to price data and broker times.

I would believe the calculations to be the same, but I meant sig figs as in TradingView would have numbers to 0.0005 for example while MT4 would not round up and will have 0.00047. They're usually very small, under the smaller time frames, the difference in both programs are big enough to cause me issues in my trading. Thanks for the help.
 
Ron N.:

Hey, I'm trying to use the MACD in MT4 but for some reason, the numbers in MT4 are not the same as with TradingView or other charting software. I see this more in the lower time frames such as 5 mins. My question is what MT4/MQL4 uses for sig figs? Or how does the ema/sma calculation get calculated in MT4/MQL4?

Thanks for the help!

// Standart MACD  Formule
 for(int i=0; i<limit; i++)
   {
      MacdBuffer[i]=(iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i));
      MacdMain[i]=(iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i));
      }
//---- signal line counted in the 2-nd buffer
   for(int ix=0; ix<limit; ix++)
     {
      SignalBuffer[ix]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,ix);
      MacdSinyal[ix]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,ix);
      }
          
//Corrected MACD Formule  
        
        for(int i=0; i<limit; i++)
   {
      MacdBuffer[i]=(iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i))/iClose(Symbol(),0,i);
      MacdMain[i]=(iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i))/iClose(Symbol(),0,i);
      }
//---- signal line counted in the 2-nd buffer
   for(int ix=0; ix<limit; ix++)
     {
      SignalBuffer[ix]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,ix);
      MacdSinyal[ix]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,ix);
      }
 
Mehmet Bastem:
I tried this out but the numbers seem to be more different? What difference does diving by iClose make in this case?
 
Ron N.:
I tried this out but the numbers seem to be more different? What difference does diving by iClose make in this case?

Equalizes level levels in all pairs.

 
Mehmet Bastem:

Equalizes level levels in all pairs.

I see. Thank you. I will continue to analyze it and compare it. Appreciate the help!
Reason: