How to change one of the MA in an EA from Exponential to Simple?

 

Hello everyone,


Looking through the code base page I found this EMA Cross EA, how can I change one of the MA’s in there to Simple?


Here is the link to the EA on the code base page.


https://www.mql5.com/en/code/8606


Thanks,

Turbo2602

 

Add two lines:


extern int ma_method1 = 0; // set to the type of MA you want
extern int ma_method2 = 0; // set to the type of MA you want


change two lines:


_old:

SEma = iMA(NULL, 0, ShortEma, 0, MODE_EMA, PRICE_CLOSE, 0);
LEma = iMA(NULL, 0, LongEma, 0, MODE_EMA, PRICE_CLOSE, 0);

_new:

SEma = iMA(NULL, 0, ShortEma, 0, ma_method1, PRICE_CLOSE, 0);
LEma = iMA(NULL, 0, LongEma, 0, ma_method2, PRICE_CLOSE, 0);