MACD sample EA with SL: Why are some orders executed w/o SL, thus producing losses?


Active Trader
Jul 15, 2010

I recently downloaded the modified sample Metatrader EA with an added SL from this website.
Backtesting it in various periods und USDGBP and EURUSD proved pretty successful with a share of profitable trades >50% (depending on SL level).
The only problem I'm facing, there are individual trades that are closed with huge losses, as apparently there hasn't been any SL on these orders. In a period of several months this usually only referns to 1-3 trades, but losses can go up to 1000! pips and thus smashing the whole performance.
I checked the code and the journal several times but can't find anything suspicious...does anyone have an idea on this? Can it be corrupted data?

Furthermore it seems that MACD open and close variables do not have any tangible effects on profits. Even in the optimization I couldn't find any values where those two variables do have an effect on profits...why is that?

Enclosed is the EA, the settings and an screenshot of one of the huge loosing trades that should not have happened given the SL!

Thanks for any comments,



  • MACD sample mit SL.mq4
    5.8 KB · Views: 63
  • settings.jpg
    29 KB · Views: 36
  • Loss trade in may 2009.jpg
    Loss trade in may 2009.jpg
    57 KB · Views: 38