Fresh MQL5 code release – perfect for enhancing your MT4/MT5 strategies.
The strategy is based on Moving Average with the periods of 5/20/40/60.
The system is described in more details here.
A detailed article devoted to the system testing is available in our magazine's issue of 07.04.2008.
You can discuss the system and make suggestions on it on our forum.
Trading Strategy Algorithm:
1. Build four SMAs (Simple Moving Averages) with the periods of 5/20/40/60.
2. Use M30 chart, symbol EUR/USD, lots 0.1.
3. StopLoss: 60 points (EUR/USD).
Grid trading done right – try the robust Grid Expert Advisor for controlled risk. Details here.
Buying:
1. SMA40 is intersected by SMA60 from bottom to top.
2. Close when they intersect in the opposite direction.
Selling:
1. SMA40 is intersected by SMA60 from top to bottom.
2. Close when they intersect in the opposite direction.
Testing on EURUSD М30 with standard inputs (StopLoss 60, no Trailing Stop or TakeProfit):

Optimization after Trailing Stop and TakeProfit have been added to the EA:
![]()
Testing on EURUSD М30 after optimization (for the same time period):

You can view a forward test outside the optimization area in our magazine's issue of 07.04.2008.
Complement community code with advanced automation from RobotFX.
8040