EMA Crossover EA with ADX Filter

Hello everyone,

I created an EA using a builder (I have almost zero experience on coding)

This EA is based on EMA Crossover and ADX, ADX is used to filter sideway market, it also has martingale option that can be turned off (just set MM_Martingale_Loss_Factor to 1)

The rules are very simple and basic

Buy Rules :

  1. Fast EMA cross above slow EMA
  2. ADX value is adove certain number (25 by default)
    Sell Rules :
  3. Fast EMA cross below slow EMA
  4. ADX value is adove certain number (25 by default)

Exit Rules :

  1. Fast EMA cross below slow EMA for buy and vice cersa for sell
  2. TP is ATR x TP_Multiplier
  3. SL is ATR x SL_Multiplier

Additional rules :

  1. Fast_MA period must be smaller than Slow_MA period
  2. TP_Multiplier must be greater than SL Multiplier

The EA can be backtested with “Open Price” model.

Here is the backtest graph for EURUSD H1 set file

And this is for M30 set file

The EA should be optimized first before use, and again be aware because it also has martingale option that can be turned off (just set MM_Martingale_Loss_Factor to 1)

The backtest result, the EA file and set file for EURUSD H1 are attached below
EA 20230108.zip (123.4 KB)

Hope you’ll find it useful.

Best regards.

1 Like

By the way MM_Martingale_Loss_Factor is set to 1.5 by default, that means lot will be multiplied by 1.5 if last trade was a loss, however TP_Multiplier is always greater than SL_Multiplier, if you set SL smaller than TP the EA won’t open any trades.

The EA also won’t open any trades if Fast_MA value is greater than Slow_MA.

I made it this way, to ensure that the EA will always follow common trend strategy in optimization process.

Well that pretty awesome you put this together with no experience!

Is this your first EA?

Thank you,

No, I’ve created several EAs using EA Builder software before, all of them use simple rules such as price cross indicator A, indicator A cross indicator B and indicator A above/below X value.

The EA help me to test some basic or free strategies on internet, and find better parameter for the strategies.

1 Like


the EA and set file on the first post has been updated, there is an error in previous version, please redownload the EA and replace the previous version.

Best regards.

What settings are you using for the fast and slow EMA?

The settings file are attached in the first post, of course you can do experiment by your self to find the best setting for you

Looks pretty good. Are you able to code them in different language like C++ or Pine Script for TV?

Use chatGPT to rectify your coding