Expert Advisors: Simple Expert Advisor based on the Simple Moving Average and ADX

 

Simple Expert Advisor based on the Simple Moving Average and ADX:

This simple Expert Advisor uses Simple Moving Average and ADX indicators, as considered in the article "Step-By-Step Guide to writing an Expert Advisor in MQL5 for Beginners".

It differs from the EA of the article, it doesn't control already opened positions. It shows the best results for 30mins, 1H, и 2H.

Author: Samuel

Simple Expert Advisor based on the Simple Moving Average and ADX

 

Kudos to the author for the detailed description of the code!

I studied MQL and MQL4 myself on the basis of MACD sample Expert Advisor. It is easier to study MQL5 on the basis of this Expert Advisor, as every line of the code is commented on.

 

1.Thanks to the author for the informative article.

2.Why the author does not apply, additionally, for universality, _Digits==3 in the

if(_Digits==5),примерно так if(_Digits==5 || _Digits==3)?
Without taking into account _Digits==3, the Expert Advisor will not work properly on the corresponding instruments.
 

At TFs smaller than H1 the deposit is lost. Example M30.

It gives good results on TF H4, with parameters SL30, TP100, period ADX 8, period MA 8, ADXmin22, number of lots 0.1, deposit 3000.

 

Why when changing different parameters StopLoss=30; and TakeProfit=100; the result is the same (trades the same) when testing ?

And nothing works at all:

//--- Is the number of bars enough to work
if(Bars(_Symbol,_Period)<60) // total number of bars on the chart is less than 60?
{
Alert("There are less than 60 bars on the chart, EA will not work!!!");
return(-1);

}

 

I am new to the forum here, I would like to know that how this EA can be downloaded and used in a real a/c .

Thanks and regards

 
rmks1960:

I am new to the forum here, I would like to know that how this EA can be downloaded and used in a real a/c .

Thanks and regards

I am assuming by a/c, you wanted to say account?

 You can use this EA with your real account  just the same way you are using it with your test account.  

 
How to use it on mq4 if possible ? code inserted 91 error 8 warnings
 
alemparaiso:

Hello, I installed your EA but is giving this error:


CG 2 00:21:53 Trades '803012 ': 00:10 failed market sell EURUSD sl: 1.28152 tp: 1.26852 [Unsupported filling mode]
 
Good EA. But the SL and TP settings aren't working. Anybody an advice?
 
MT5T:
Good EA. But the SL and TP settings aren't working. Anybody an advice?

TP and SL not executed has been asked several times in forum. Use stop pending order for TP and limit pending order for SL, these pending should opposite to opened position.

For example, if you have 1 lot open buy, then use 1 lot sell stop as TP and 1 lot sell limit for SL.