• Overview
  • Reviews (3)
  • Comments (37)
  • What's new

Triple Moving Average EA

This Expert advisor (EA) places trades when 3 moving averages (MA) are in sequence and at a certain distance from each other. It adopts a not very well known strategy used by some institutional traders. It involves the MAs 10, 20 and 30. The strategy works best on the H4 time frame but can also produce good results on H1 and D1 on some pairs. Works best with a trailing stop.

The EA can also be used in a more universal way by using other MAs than the ones which are intended for the strategy.

The behavior of the EA can be explained in the following steps (please also see separate screenshot for visualization):

  1. Look for a trade when all 3 MAs are in sequence and the minimum distance between them has been reached.
  2. Exit when trailing stop or any other condition (described below) has been hit.


  • Spread and slippage filter.
  • Moving average trend filter.
  • Possibility to select between adding a fixed lot or let the system set the lot size according to risk percentage.
  • Possibility to trade in a reverse way (buy when sell, sell when buy) by setting a very wide distance between the MAs which could indicate a reversal.

The EA is NFA FIFO compliant and supports ECN accounts.

It is recommended to trade a portfolio of minimum 8 symbols at the same time to reduce risk as much as possible. Please also make sure that you test the EA on a demo account and let at least 20 trades be done. I recommend you to start with the preset (.set) files (https://www.mql5.com/en/blogs/post/715456) when you will do your own backtesting and fine tuning in the strategy tester.


  • Time frame to operate on - Default is H4. This is intended to work as a protection so that no unwanted trades will be taken in case the time frame on the chart is manually changed.
  • Send alert instead of opening trade - When set to 'true' an alert will be sent instead of opening a trade.
  • Reverse system (sell when buy, buy when sell) - 'true' or 'false'.
  • ECN account - 'true' or 'false'.
  • Open buy/sell order - 'true' or 'false'.
  • Trade only between given times (computer time) - Hour filter for opening trades.
  • Trade from/to time - Hour from/to.
  • Maximum allowed slippage in points - Please note that not all brokers/account types support slippage control.
  • Maximum allowed spread in points (0 = not used) - Can be set to avoid taking trades with high spread directly after midnight market opening or at news releases. Could be used if you have variable spreads.
  • Allow pin bar on previous candle - 'true' or 'false'. Trades will not be taken if previous candle is a pin bar where the tail is >= 60% of the candle size.
  • Risk in percentage (>0 = auto lot) - If set to 0 the Manual lots value below will be used. Sets the risk for the trade based on Account Free Margin. It will implement true risk only if combined with a stop loss.
  • Point value for risk percentage - Default is 1. Is normally not changed. Only in some rare cases where the broker has unconventional tick values for CFDs. A setting of 0.1 could then be used.
  • Manual lots - Will be used if Risk above is set to 0.
  • Type of stop-loss/exit - Combo box with the following selections:
    • MA1/MA2 cross (default) - The position will be closed automatically when the first MA has crossed the second at candle close.
    • Fixed
    • MA1/MA2 distance < min. distance - Will speed up the closing (stop loss) of the order. Will not wait for the first MA to cross the second. Instead it will close the order when the distance between them is less than the minimum distance. Has been proven to be effective on some pairs.
    • MA1/MA2 distance < than MA2/MA3 distance
    • Which of the above occurs first
  • Fixed stop-loss
  • Take profit method - Combo box with the following selections:
    • Fixed
    • Trailing stop
    • Risk/Reward (based on SL)
  • Fixed take profit
  • Trailing stop - Will trail the stop loss constantly with the distance you have set as soon as the trade is in profit. If the Trailing step parameter is set to 0 then the trailing stop will be adjusted each 3rd second.
  • Trailing step - The trailing stop will be adjusted every time the price has moved the amount of points you have set here.
  • Risk/Reward ratio: You need to set the “Take profit method” parameter to Risk/Reward in order for this value to have any effect. You need also to set “Type of stop-loss” to Fixed and a fixed stop loss value. A stop loss value of 200 points and a R/R ratio of 1.5 would mean that the take profit level would be automatically set to 300 points when an order is opened.
  • Break-even (0 = disabled) - Break-even level.
  • Break-even trigger - Price has to reach this level before the stop loss will be moved to break even.
  • Use trend moving average - With this option enabled trades will only be placed when the signal is above/below the MA.
    • MA period
    • MA method
    • MA time frame
  • Signal moving average periods - Default values are 10, 20, 30.
  • Signal moving average shifts - Default values are 0. You could for instance simulate the Alligator oscillator by using other values for Period and Shift.
  • Signal MA method - default is Exponential.
  • MA price type - Valid for both trend and signal MA.
  • Min. distance in points between signal MA:s - For the H4 timeframe all values between 30 and 150 points can be used (according to my back testing).
  • ALERTS (if alert instead of trade is enabled) - Set to 'true' for each alert type you would like to activate.
  • Magic number
  • Order comment
Fabio Consola
2018.06.15 06:11 

così così...Non mi convince a fondo...

2018.03.20 00:13 

This is a solid EA. The distance between Moving averages I find to be a nice filter for the crossover entry. There are several exit strategies. I have tested this EA extensively in Strategy Tester, and currently trading it on a live account. The author has been very helpful, answering my questions. It performs best for me on one hr and 4 hr time frames.

2018.03.03 23:10 

Simple concept, bug free and it works under the right circumstances. The developer is pretty fast and good in communication and the price is something one can afford.

I am trying it on a live account along with other EAs. You need to spend some time figuring out the money management part...then it works as advertised! Does it make money? Yes, but this is not a scalping tool. It is good for higher time frames and longer horizon.

Version 1.3 - 2018.05.02
- added possibility to set MA shift for each of the 3 moving averages
Version 1.2 - 2018.02.02
- added option to prevent trade if previous candle is a pin bar
- added possibility for trailing step
Version 1.1 - 2018.01.08
- added Risk/Reward logic
- added combo boxes for stop-loss (exit) and take profit methods
- added parameter checkup when loading the EA
- added possibility to disable comments on chart
- added possibility for exit if the distance between the first and second MA is less than the distance between the second and third MA