EA-22304 · Trend Following

Technical Trader

This EA uses a dual moving average crossover combined with a statistical support/resistance detection mechanism to generate buy and sell signals. It scans historical close prices to find levels where price has touched multiple times (resistance/support clusters) and enters trades when price is near these cluster levels and the MAs confirm trend direction. Positions are managed with fixed stop loss and take profit, executing only on new bars.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskHigh risk
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1, H4, D1
IndicatorsSMA, Price Cluster Support/Resistance
AuthorMetaQuotes Software Corp.

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD+7.41%+6.41%2.95%14451.00%1.532.515+$4.95Reliable
GBPUSD+1.58%+1.37%4.90%14450.30%0.280.325+$0.94Reliable
USDJPY+4.69%+4.06%5.65%15542.20%0.930.837+$3.05Reliable
XAUUSD+70.51%+55.41%48.61%15246.40%1.321.4510+$45.06Reliable

Profitable on 4 of 4 markets with reliable results.

Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.

Against the other Trend Following EAs with a reliable result on the same market: EURUSD: better than 96% of 95 · GBPUSD: better than 58% of 95 · USDJPY: better than 94% of 95 · XAUUSD: better than 82% of 96

Month by month

MarketMonths with a gainBest monthWorst month
EURUSD85%+1.81% 2026-08-1.06% 2026-07
GBPUSD62%+2.30% 2026-08-3.01% 2026-07
USDJPY54%+4.16% 2026-02-2.20% 2026-05
XAUUSD46%+73.35% 2026-02-18.37% 2026-07

From the backtest equity curve, sampled about every two days; only reliable results.

Blow-up risk: No blow-up pattern found

None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.

High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →

Strategy analysis

The strategy concept combines dual moving average crossover with a price cluster-based support/resistance detection mechanism. Entry conditions require: for buys, the short-period MA(25) must be above the long-period MA(30) and the current ask price must be near and above a resistance cluster level (within 0.0005); for sells, the short MA must be below the long MA and the current bid price must be near and below a support cluster level. Exit conditions rely entirely on fixed stop loss and take profit with no trailing stop or conditional exit logic. Position sizing uses the symbol's minimum lot size with no scaling or position accumulation logic. Money management attempts to check free margin but contains a critical bug—the margin variable is used uninitialized in the comparison, making the check effectively meaningless. Additionally, the hardcoded 0.0005 threshold is completely inappropriate for instruments like XAUUSD, the buy order uses a hardcoded magic number 15489 instead of the input parameter EA_Magic, and the 5/3 digit multiplier for SL/TP may not handle all broker configurations correctly.

Strengths

  • Uses a statistical price clustering method to identify support/resistance levels, which is conceptually innovative
  • Only executes trading logic on new bar formation, avoiding high-frequency duplicate signals
  • Has basic stop loss and take profit protection mechanism in place
  • Includes point value adaptation for 5/3 digit brokers
  • Contains data synchronization check logic during initialization for robustness

Weaknesses

  • The margin variable is used uninitialized, making the money management check completely ineffective and potentially allowing trades with insufficient margin
  • Buy orders use hardcoded magic number 15489 instead of the input parameter EA_Magic, creating inconsistency with sell orders
  • The 0.0005 price proximity threshold is hardcoded and completely unusable for high-value instruments like XAUUSD
  • The support/resistance scanning uses a 0.001 step loop which is extremely inefficient and the precision is inappropriate for all instruments
  • PositionSelect only checks for a single position per symbol, unable to handle multiple positions or hedging accounts
  • ORDER_FILLING_FOK is hardcoded but not supported by all brokers, which will cause order rejection
  • The statParam struct is defined but never used, representing dead code

Possible improvements

  • Fix the margin variable initialization issue by using OrderCalcMargin to properly calculate required margin before comparison
  • Replace the hardcoded price proximity threshold with an ATR-based or tick-value-adaptive parameter to work across all instruments
  • Unify buy and sell order magic numbers to use the EA_Magic input parameter, removing hardcoded values
  • Optimize the support/resistance scanning algorithm to avoid O(n²) loops, using histogram statistics or sorted clustering instead
  • Add automatic fill mode detection logic to select the appropriate ORDER_FILLING based on broker-supported modes

Risk assessment

Overall risk: High risk

  • Uninitialized margin variable makes money management check ineffective, potentially placing trades with insufficient margin
  • Hardcoded price proximity threshold is invalid for non-forex instruments, potentially generating incorrect signals
  • Inconsistent magic numbers between buy and sell orders cause position management confusion, potentially failing to identify EA-held positions

Evaluation scores

Code quality1.0
Strategy logic2.0
Risk management1.0
Robustness2.0
Innovation3.0
Documentation1.0
Overall1.7

Parameters

ParameterDefaultDescription
StopLoss30Stop loss in points (0=structure-based)
TakeProfit100Take profit in points (0=structure-based)
EA_Magic12345EA magic number
MA_Period125Fast moving average period
MA_Period230Slow moving average period
resistance15Resistance/support cluster count threshold

Similar Trend Following EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.