Download MetaTrader 5

iMACD: signal line with EMA code

To add comments, please log in or register
lnchml
6
lnchml  

Hi,

the calculation of "macd_signal" in my EA code is:

double macd_main=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);
double macd_signal=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);

 

but regarding the documentation this will calculate "macd_signal" with MA9(MACD main) instead of EMA9(MACD main). Please, can anyone help how to correct the code in order to calculate "macd_signal" with EMA? 

Thank you. 

To add comments, please log in or register