- Product type
- Expert advisor
- Platforms
- MT4 · MT5
- Market / symbol
- Gold, FX majors, FX minors
- Experience level
- Beginner
- Delivery
- File download from your dashboard
- Last update
- November 30, 2026
- Broker
- Any broker
- Product type
- Expert advisor
- Platforms
- MT4 · MT5
- Market / symbol
- Gold, FX majors, FX minors
- Experience level
- Beginner
- Delivery
- File download from your dashboard
- Last update
- November 30, 2026
- Broker
- Any broker
Overview
The two moving average crossover is usually the first strategy a trader learns. Adjustable MA runs exactly that, with no extra filters, so you can change the periods, MA type, stop and trading hours and see in the tester what happens.
The original author states plainly that this EA is not profitable and should be used on a demo account only. We publish it in the same spirit: a free, open strategy to study and test. A good result over one backtest period guarantees nothing about the future, and running it on a live account carries a real risk of losing money.
- Trades the cross of two MAs with your choice of period, method and applied price
- Minimum-gap filter between the MAs to cut down false crosses
- Optional stop-loss, take-profit and trailing stop
- Trading limited to chosen hours and weekdays
- Direction choice: long only, short only or both
- On-chart status text with
DisplayStatusComment
It is a good starting point if you are new to the MetaTrader Strategy Tester, or want to see how a plain trend system behaves in a ranging market.
Source and licence
This tool is the open-source project Adjustable MA by EarnForex.com, released under the Apache 2.0 licence. The source code is included in the download unchanged, with the licence text next to it. TradeKit provides the description, install guide and support. Original repository: github.com/EarnForex/Adjustable-MA
Strategy logic
Detecting a cross
- The EA decides only when a new candle opens and reads both MAs on the last closed candle.
- Of
Period_1andPeriod_2, the smaller is the fast MA and the larger the slow MA. - The state is bullish when the fast MA is at least
MinDiffpoints above the slow MA, and bearish in the opposite case. - A cross is recorded when the state flips from bullish to bearish or back.
Entry and exit
- On a bullish cross the existing sell is closed and a buy is opened; on a bearish cross the reverse.
- With default settings stop-loss and take-profit are zero, so a trade closes only on the opposite cross and the EA is in the market almost all the time.
- If you set
StopLoss,TakeProfitorTrailingStop, they apply to every trade. - Trailing begins once profit reaches
TrailingStopTriggerProfit; if that is zero, once profit equals theTrailingStopdistance itself.
Time filter
No new trade is opened outside the allowed hours and weekdays. CloseTradesOutsideTradingTime decides whether an opposite cross still closes the open trade in those hours, and DoTrailingOutsideTradingTime whether trailing continues.
Position size
By default the size is the fixed Lots. With UseMM it is derived from free margin and has nothing to do with the stop distance.
Specifications
Requirements
- MetaTrader 4 or MetaTrader 5
- Runs on any symbol and timeframe; the two periods must differ
- Recommended for backtesting and demo accounts only
- MinDiff and Slippage defaults differ between MT4 and MT5; align them before comparing results
- Platforms
- MT4MT5
- Delivery
- Use case
- Trend following
- Market
- Gold، FX majors، FX minors
- Experience level
- Beginner
Compatible brokers
Which brokers this product works with, and which it works best with.
No broker restriction: it works with any broker that offers the product's platform.
The broker choice is yours; TradeKit is not a broker. Check account terms before depositing. All brokers
Input parameters
| Parameter | Default | Description |
|---|---|---|
Period_1Period of the first moving average |
20 |
Period of the first moving average |
Period_2Period of the second moving average; the smaller of the two is the fast MA, the larger the slow MA |
22 |
Period of the second moving average; the smaller of the two is the fast MA, the larger the slow MA |
MA_Method_FastType of the fast MA (SMA, EMA, SMMA or LWMA); the slow one is set with MA_Method_Slow |
MODE_EMA |
Type of the fast MA (SMA, EMA, SMMA or LWMA); the slow one is set with MA_Method_Slow |
MinDiffMinimum gap between the two MAs, in points, for a cross to count (default 3 in MT5, 30 in MT4) |
3 |
Minimum gap between the two MAs, in points, for a cross to count (default 3 in MT5, 30 in MT4) |
StopLossStop-loss in points; 0 means no stop-loss |
0 |
Stop-loss in points; 0 means no stop-loss |
TakeProfitTake-profit in points; 0 means no take-profit |
0 |
Take-profit in points; 0 means no take-profit |
TrailingStopTrailing stop distance in points; 0 turns it off |
0 |
Trailing stop distance in points; 0 turns it off |
TradeDirectionAllowed direction: long only, short only, both, or none (closing and trailing only) |
TRADE_DIRECTION_BOTH |
Allowed direction: long only, short only, both, or none (closing and trailing only) |
StartHourStart hour of the trading window in server time; used with StartMinute, EndHour and EndMinute |
0 |
Start hour of the trading window in server time; used with StartMinute, EndHour and EndMinute |
CloseTradesOutsideTradingTimeClose the open trade on an opposite cross even outside the trading window |
true |
Close the open trade on an opposite cross even outside the trading window |
LotsFixed lot size when UseMM is off |
0.1 |
Fixed lot size when UseMM is off |
UseMMSize from free margin: LotsPer10000 lots for every 10,000 of free margin |
false |
Size from free margin: LotsPer10000 lots for every 10,000 of free margin |
Install guide
- Unzip the download. It contains an
MQL4orMQL5folder. - In MetaTrader choose File › Open Data Folder and copy the folder’s contents into the folder of the same name.
- Restart the terminal, or right-click in Navigator and choose Refresh. The source compiles on its own.
- To backtest, open the Strategy Tester and pick Adjustable_MA from the expert list.
- To run it on a demo chart, turn on Algo Trading (AutoTrading in MT4) and drag the EA from Expert Advisors onto the chart.
Changelog
-
v1.08 MT4 New November 30, 2026
- Published on TradeKit
-
v1.08 MT5 November 30, 2026
- Published on TradeKit
Buyer reviews
No reviews yet.
Only verified buyers can review. Reviews are moderated before publishing.
Only verified buyers can review. Reviews are moderated before publishing.
Sign in to write a reviewFAQ
Is this EA profitable?
Why is there no stop-loss by default?
Why does the same setup give different results in MT4 and MT5?
Does UseMM size trades by risk?
Can I use it only to manage open trades?
Related products
More Expert advisors and tools from the same family
Risk warning