Popular results

$ £ ¥
¥ £ $

Adjustable MA 3G Expert Advisor

Adjustable MA 3G is a highly customizable Forex expert advisor that is based on the custom 3rd Generation Moving Average indicator and the classic two MA cross strategy. You can adjust the MA periods, MA methods, MA price type, minimum MA difference, stop-loss, take-profit, trailing stop, slippage and money management parameters. This expert advisor always opens a position on a cross and closes it on the next cross (if it was not closed earlier by the SL or TP).

Warning!

The latest backtest of this expert advisor has shown a complete account wipeout. Do not run this EA on a live account! Use it for educational purpose only.

It offers an alternative to the standard Adjustable MA expert advisor.

Warning!

This expert advisor requires a free 3rd Generation Moving Average indicator installed in your MetaTrader platform to work.


Input parameters

Main

  • Period_1 (default = 30) — the period of the first moving average.
  • Period_2 (default = 35) — the period of the second moving average.
  • Period_Sampling_Fast (default = 196) — the sampling period of the fast moving average.
  • Period_Sampling_Slow (default = 160) — the sampling period of the slow moving average.
  • MA_Method_Fast (default = MODE_EMA) — the calculation method of the fast moving average.
  • MA_Method_Slow (default = MODE_EMA) — the calculation method of the slow moving average.
  • MA_Applied_Price_Fast (default = PRICE_TYPICAL) — the applied price for the fast moving average.
  • MA_Applied_Price_Slow (default = PRICE_TYPICAL) — the applied price for the slow moving average.
  • MinDiff (default = 10) — a minimum difference between two moving averages in points for the cross to count.
  • StopLoss (default = 1700) — a stop-loss (in points) to be used with trades.
  • TakeProfit (default = 600) — a take-profit (in points) to be used with trades.
  • TrailingStop (default = 0) — a trailing stop (in points) to be applied to trades.
  • TrailingStopTriggerProfit (default = 0) — the profit in points for the trailing stop to trigger. Set to zero to disable.
  • TradeDirection (default = Both) — the direction of the trades to take.
  • StartHour (default = 0) — the start time hour (by server time) for the period to trade in.
  • StartMinute (default = 0) — the start time minute (by server time) for the period to trade in.
  • EndHour (default = 23) — the end time hour (by server time) for the period to trade in.
  • EndMinute (default = 59) — the end time minute (by server time) for the period to trade in. The end time minute is inclusive, so if set to 59, the EA will trade until 00 of the next hour.
  • TradeOnMonday (default = true) — if true, the EA will trade on Mondays.
  • TradeOnTuesday (default = true) — if true, the EA will trade on Tuesdays.
  • TradeOnWednesday (default = true) — if true, the EA will trade on Wednesdays.
  • TradeOnThursday (default = true) — if true, the EA will trade on Thursdays.
  • TradeOnFriday (default = true) — if true, the EA will trade on Fridays.
  • TradeOnSaturday (default = true) — if true, the EA will trade on Saturdays.
  • TradeOnSunday (default = true) — if true, the EA will trade on Sundays.
  • CloseTradesOutsideTradingTime (default = true) — if true, the EA will continue closing its trades outside of the trading period set using the input parameters above.
  • DoTrailingOutsideTradingTime (default = true) — if true, the EA will continue trailing the stop-loss of its trades outside of the trading period set using the input parameters above.

Money management

  • Lots (default = 0.1) — a trading volume in standard lots.
  • UseMM (default = false) — if true, the EA will apply its money management rules.
  • LotsPer10000 (default = 1) — how many standard lots per 10,000 of balance currency to use if UseMM is set to true.

Miscellaneous

  • Slippage (default = 30) — maximum tolerable slippage in points.
  • OrderCommentary (default = "Adjustable MA 3G") — the commentary for positions opened by this EA.
  • DisplayStatusComment (default = true) — if true, a status panel will be displayed in the top-left corner of the chart with details about the EA's operation.
  • Magic (default = 29472394) — a Magic number to use with trades.

MiniFAQ

What are the best settings to use with this EA?

There are no known best settings. We didn't find any consistently profitable combinations of parameters. You are welcome to backtest it to try and find some worthwhile strategies.

 

This EA is ECN-compatible. If you are trading with an ECN broker (with market execution for orders), you cannot set SL/TP on position opening. You have to open a position first without SL/TP and only then modify it, adding stop-loss and/or take-profit level. This EA will do it automatically.



Discussion

Warning!

Before asking questions about installing this expert advisor, please read our MetaTrader Expert Advisors Tutorial to learn how to install an EA.

Do you have your own trading results or any other remarks regarding this expert advisor?

Discuss Adjustable MA 3G with other traders and MQL programmers on our forum.


Changelog

1.05 - 2026-04-17

  • Added a status panel via the chart commentary.
  • Added an input parameter for trailing stop trigger profit.
  • Added input parameters to restrict trading on certain days of the week.
  • Added support for cross-midnight time periods.
  • Added validation for more of the input parameters on initialization.
  • Added None as a trading direction to only close trades or trail stops without opening new positions.
  • Changed the start/end time input parameters from strings to integers to allow backtesting optimization based on time periods.
  • Changed the EA to work with points only without assuming what a pip is for a given trading instrument.
  • Changed Magic number from an implicitly calculated value to a modifiable input parameter.
  • Fixed a bug with position closing that could (very rarely) occur with the MT4 version of the EA.
  • Fixed multiple issues in the money management function of the EA.

1.04 - 2025-02-10

  • Added an option to restrict trading to a certain period of the day.
  • Added an option to restrict trading to a single direction.
  • Added an input parameter to set the order commentary.
  • Optimized trailing stop to make it work more reliably.
  • Changed how trades are opened and closed to allow for several attempts in case of a failure.
  • Refactored the source code.

1.03 - 2018-07-25

  • Added automatic detection of execution mode used in the trading account.
  • Fixed EA's operation in MT5 hedging mode.
  • Improved the source code by making simpler and more serviceable.

1.02 - 2017-03-16

  • Added more inputs to control the moving averages used in the EA.
  • Added filtering for invalid input parameters.

1.01 - 2014-08-06

  • Fixed a bug with zero divide error.

1.00 - 2011-11-01

  • Adjustable MA 3G expert advisor released.