EA based on MA separation


I have been coding different expert's but all the indicators I would try to base it off were always the ones that redraw past bars. I figured I would try to code an expert from the default indicators. I did try RSI but that did not work the way I planned. I decided I would just use a couple moving averages and base it off of the separation between the two. I got the idea from and indicator does about the same thing but I tweaked it to do signals a different way. Attached is the expert and the indicator with alerts (not needed for expert).

When the separation is positive is means the fast MA crossed above the slow MA and reverse for negative.

The way it works is when the separation is positive and is greater than the points (level) you set and crosses back down below that level it sells at the close of the bar. It exits when the separation hits the level at the negative side or your stop loss (if set). It will then enter once the separation has passed back up through the negative separation level and exit when it closes above the positive level.

I found it works best on the 30 and hour time frames. The best settings are already set for the moving averages. Tweaking the points can have a big impact on the success. I found that it can win about 60 to 75% of the trades and come out with twice as much profit to losses.

If anyone has suggestions on a way to make it better, let me know. I have not done any forward testing yet but have done some back testing (mostly on the EURUSD.