iMACD: signal line with EMA code

 

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. 

Reason: