Adjustable MA (MA crossover EA)
EA that trades the crossover of two moving averages, with adjustable method, period and price
EMA crossover EA with ADX/RSI/session/spread filters, ATR-based SL/TP and a trailing stop
Open source, MIT License, by Viprasol Tech Private Limited. See licences
First release on this site.
Install the EA in MetaTrader 5 and drag it onto the chart of the symbol you want, with Algo Trading on. The EA decides on closed bars of SignalTF (PERIOD_CURRENT = chart timeframe), while break-even and trailing run on every tick.
Check the lot sizing mode (MMMode) first: the default is a risk percentage of equity; MM_FIXED_LOT uses FixedLot instead. Set SessionStartHour and SessionEndHour to match your broker's server time. With CloseOutsideSession on, the EA closes any open position outside the session window.
MagicNumber identifies the EA's own orders; if you run several charts of the same symbol, give each a different Magic Number. Test in the Strategy Tester and on a demo account first.
| Name | Default | Description |
|---|---|---|
| FastPeriod | 12 | Period of the fast MA. |
| SlowPeriod | 26 | Period of the slow MA. |
| MAMethod | MODE_EMA | MA type (EMA, SMA and so on). |
| SignalTF | PERIOD_CURRENT | Timeframe used for the signals and filters (PERIOD_CURRENT = chart timeframe). |
| MMMode | MM_RISK_PCT | Lot sizing mode: MM_FIXED_LOT (fixed) or MM_RISK_PCT (risk percentage of equity). |
| FixedLot | 0.1 | Lot size when MM_FIXED_LOT is used. |
| RiskPercent | 1 | Risk per order as a percentage of equity when MM_RISK_PCT is used (computed from the SL distance). |
| MaxLotCap | 5 | Upper limit on the lot size the EA opens per order. |
| ATRPeriod | 14 | ATR period used for SL, TP, break-even and trailing. |
| SL_ATR | 2 | Stop-loss distance as a multiple of ATR. |
| TP_ATR | 3 | Take-profit distance as a multiple of ATR. |
| UseBreakEven | true | Move the SL to break-even once profit reaches the trigger. |
| BE_TriggerATR | 1 | Profit, as a multiple of ATR, needed before the SL is moved to break-even. |
| BE_OffsetPts | 5 | Points above the entry (below for a Sell) at which the SL is placed on break-even, locking a small profit. |
| UseTrailing | true | Enable the ATR trailing stop. |
| Trail_ATR | 2 | Trailing distance from the current price, as a multiple of ATR. |
| Trail_StepPts | 10 | Minimum improvement in points before an SL modification is sent. |
| UseADXFilter | true | Require trend strength from ADX. |
| ADXPeriod | 14 | ADX period. |
| ADXMinLevel | 20 | Minimum ADX value that allows entries. |
| UseRSIFilter | true | Require the RSI filter. |
| RSIPeriod | 14 | RSI period. |
| RSIBuyMax | 70 | Block Buys if RSI is above this value. |
| RSISellMin | 30 | Block Sells if RSI is below this value. |
| UseSpreadFilter | true | Block entries when the spread is too wide. |
| MaxSpreadPts | 30 | Maximum spread, in points, that allows an entry. |
| UseSession | true | Restrict entries to a time window and weekdays. |
| SessionStartHour | 7 | Start hour of the entry window (server time). |
| SessionEndHour | 20 | End hour of the window (server time). If it is lower than the start hour the window wraps past midnight. |
| TradeMonday | true | Allow entries on Monday. |
| TradeTuesday | true | Allow entries on Tuesday. |
| TradeWednesday | true | Allow entries on Wednesday. |
| TradeThursday | true | Allow entries on Thursday. |
| TradeFriday | true | Allow entries on Friday. |
| CloseOutsideSession | false | Close the open position when outside the configured session. |
| MaxTradesPerDay | 5 | Maximum number of new trades per day (server day). 0 means unlimited. |
| ExitOnOppositeCross | true | Close the position when the EMAs cross in the opposite direction. |
| MagicNumber | 20250101 | Magic number the EA uses to identify its own orders. |
| MaxSlippage | 20 | Maximum accepted price deviation in points. |
| ShowDashboard | true | Show the status dashboard on the chart. |
| PanelText | clrWhite | Text colour of the dashboard. |
| PanelFontSize | 9 | Font size of the dashboard. |
| PanelX | 12 | Horizontal offset of the dashboard in pixels. |
| PanelY | 22 | Vertical offset of the dashboard in pixels. |
Defaults are the values shipped with the EA, not a recommendation. Results depend on the market and on each account. Past results do not guarantee future results. Trading carries a high risk of loss.
An EA that opens a trade when a fast EMA (default 12) crosses a slow EMA (26) on SignalTF, reading closed bars. A cross up opens a Buy and a cross down opens a Sell; the MA type can be changed with MAMethod. Entries must first pass the filters: ADX at or above ADXMinLevel (default 20), RSI not above RSIBuyMax for Buys and not below RSISellMin for Sells, spread within MaxSpreadPts, and inside the chosen session and weekdays, which default to Monday-Friday, hours 7-20 server time. Each filter can be turned off.
Every order gets an ATR-based stop-loss and take-profit (default SL 2 ATR, TP 3 ATR). Lot size is fixed or computed from a risk percentage of equity (default 1%), capped by MaxLotCap. After entry the EA moves the SL to break-even once profit reaches 1 ATR and then trails it with an ATR trailing stop; both can be switched off. A trade ends at SL/TP or on an opposite cross (on by default).
It holds one position per symbol at a time (for its Magic Number), limits new trades per day with MaxTradesPerDay (default 5), and shows a status dashboard on the chart.
Banners from the Exness partner programme

FXIDTH is an independent IB partner of Exness. This channel is not owned or operated by Exness.*Spreads may fluctuate and widen due to factors including market volatility, news events, market open/close, and others.*Processing times may vary depending on the chosen payment method.
EA that trades the crossover of two moving averages, with adjustable method, period and price
EA that places buy stop and sell stop orders outside an MA band built on High and Low prices
EA that opens trend-following Buy/Sell when the EMA slopes the same way, ADX is strong enough and +DI/-DI agree, with SL and TP.
Has alerts