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.
What are sig figs?
Calculations should be the same, but there may be differences due to price data and broker times.
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); }
Equalizes level levels in all pairs.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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!