It has been awhile since I have done anything with EA development or optimization, and I wouldn't consider myself an expert. But I have been experimenting with this EA and have made some observations - including some peculiar behavior. I have also examined the internals. Here are my findings and some suggestions for possibly improving the EA.
The first thing to notice is the very nice equity curves the EA can produce in backtesting (like "TheGMan" posted). It is not yet clear to me whether live forward testing (e.g. during the same time period as used for backtesting) would produce as nice of a result (or if it would even be profitable), partly because the EA does not control bar opening (as TheGMan's backtest assumes it does).
Here is one of my backtest results (2019 Daily, "open prices only"):
When I test the EA using the "every tick" option, I discover that the EA becomes very
unprofitable for some pairs and backtest time periods - for which it was highly profitable using the "open prices only" option. When I used the every tick option with GBPJPY on a Daily or H4 chart for 2019-01-01 to present (with some settings of my own choosing and 0.5 lots traded), it produced a fantastic steadily climbing equity curve with practically no drawdown - until about 2019-08-05 and then it proceeded to give back all of the gains.
Everything the same as before (2019 Daily), except now using every tick:
I scrutinized the GBPJPY chart and could see no reason the EA should suddenly change behavior on August 5th (i.e. start consistently losing more than winning). I tried the EA with the same settings and time period on a number of other pairs, finding some profitable, some not so profitable. One very peculiar thing however was that for every profitable pair I found, the EA became unprofitable on about the same day (August 5th). With a little more investigation, I discovered that that date corresponded fairly well with my MT4 platform having more detailed data available from that day forward (e.g. picking up the M5 timeframes). That suggests the EA is failing on more detailed data. Detailed reports from backtesting show that the EA is taking more trades when the more detailed data is used. The amount of detailed data available depends on how much history you allow the MT4 installation to retain. Your installation will likely be different from mine.
Another peculiarity is that I get slightly different results from backtests on two different time frames. I say it is peculiar because if you look at the internals of the EA, it does not make use of the particular time frame you are running it on. It opens trades at various times during each open candle, depending on volatility and not on when the candles open or close. The slightly different results (from backtests on two different time frames) tells me that the tick data MT4 presents during backtesting does depend on what chart time frame the EA is installed on (unlike real live data).
I find it very intriguing that the EA can be so smooth and profitable under the right circumstances (during backtesting), but fails when more ticks are included. And I am wondering if it might be possible to modify the EA (perhaps to emulate the conditions that exist during the successful backtests or at least reduce overtrading if that is the problem?). Possibly, it should be allowed to place the entry orders it uses only on candle open (or maybe every t minutes while there are no open orders).
One of the weaknesses of fxcodebase is the sparcity of documentation. I am often guessing what the selectable parameters do (Like what do SAR_Step and TrailingStep do? My familiarity with parabolic stop and reverse does not quite carry over). "SAR" in "SimpleSAR" actually means "stop and reverse," but (correct me if I am wrong) that is not really what the algorithm in "SimpleSAR" seems to be doing (which makes the meaning of the parameter SAR_Step all the more confusing). The "SimpleSAR" algorithm seems to start all trades by placing competing equidistant entry orders above and below the current price (SAR_Step/2 away, also taking spread into account). When one of the entry orders is hit, a trade opens and the competing order is cancelled. A trailing stop is used to control risk and ultimately close all trades (no take profit limit is used). The success of the EA relies on market movement continuing in the direction which triggered the open position.
I also found a couple of possible bugs in the SimpleSAR_EA2.mq4 code. On (or about) line 105, you will see an "if" structure:
if (TicketB==0 && TicketS==0 && TicketBS==0 && TicketSS==0)
{
Inside the if statement brackets {} you will find an if-then-else structure (on or about line 109):
if (TicketBS==0)
{
res=OrderSend(Symbol(),OP_BUYSTOP,Lots,New_Level,0,P_Level,0,"",MAGICMA,0,Blue);
}
else
{
...
The issue is that we already know TicketBS==0 because of the first "if" on line 105 requires it (so "then" always gets executed and never "else").
Same issue with the if-then-else structure which starts on line 128. This kind of issue also exists in the previous versions as well.
I am not sure what was intended, but it seems like something might need to be fixed?
Please understand that I am trying to provide constructive comments that might help improve the EA. I hope my comments are not too confusing. I appreciate the work you guys do and that you make it freely available.