EA-1062 · Trend Following

Exp_X2MA

This EA trades based on crossover signals from a double-smoothed moving average indicator (X2MA). It opens buy positions when the X2MA values turn upward and sell positions when they turn downward, with configurable permissions for entry and exit. The strategy applies two sequential smoothing algorithms to a selected price type to generate trend-following signals.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★★☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsX2MA, SMA, JJMA
AuthorCopyright © 2012, Nikolay Kositsin

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD0.00%0.00%0.00%0—————Not convertible yet
GBPUSD0.00%0.00%0.00%0—————Not convertible yet
USDJPY0.00%0.00%0.00%0—————Not convertible yet
XAUUSD0.00%0.00%0.00%0—————Not convertible yet

Why this EA never traded: no entry rule survived the conversion.

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.

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 is based on detecting trend reversals through direction changes in a double-smoothed moving average (X2MA). Entry conditions are: a buy signal is generated when X2MA values consecutively rise (Value[1]<Value[2] and Value[0]>Value[1]), and a sell signal is generated when values consecutively decline (Value[1]>Value[2] and Value[0]<Value[1]). Exit conditions rely on fixed stop loss and take profit in points, while reverse signals also permit position closing when enabled. Position sizing is controlled by the MM parameter, where negative values represent fixed lot sizes and positive values represent deposit share-based calculations. Money management leverages functions from TradeAlgorithms.mqh, supporting dynamic position sizing based on account balance percentage. The strategy is fundamentally a trend-following system that uses double smoothing to reduce false signals, but may generate frequent whipsaw losses in ranging markets.

Strengths

  • Double smoothing algorithm effectively reduces market noise and false signals
  • Supports 10 smoothing methods and 9 price types, offering highly flexible parameter configuration
  • Buy/sell open and close permissions can be independently controlled for flexible strategy combinations
  • Uses IsNewBar mechanism to prevent duplicate trades within the same bar
  • Complete stop loss and take profit parameters provide basic risk control

Weaknesses

  • Lacks a ranging market filter, prone to frequent whipsaw entries and exits in sideways markets
  • No spread filter or slippage protection mechanism, trading costs may be excessive in high-spread environments
  • Default stop loss of 1000 points and take profit of 2000 points are very large, potentially causing severe single-trade losses
  • Depends on external custom indicator X2MA and SmoothAlgorithms.mqh library, reducing portability and independence
  • No maximum position limit or consecutive loss protection mechanism

Possible improvements

  • Add ADX or volatility filter to disable trading during low-trend-strength or ranging conditions
  • Add spread filter and maximum position count limit to reduce trading cost risk and overexposure risk
  • Add trailing stop functionality to better protect floating profits

Risk assessment

Overall risk: Medium

  • Default stop loss of 1000 points is very large, potentially causing severe single-trade losses
  • No spread filter, high-spread instruments may frequently trigger stop losses
  • Trend-following strategy may produce consecutive losses in ranging markets
  • When MM=-0.1, fixed 0.1 lot is used regardless of account size

Evaluation scores

Code quality3.0
Strategy logic3.0
Risk management3.0
Robustness3.0
Innovation2.0
Documentation2.0
Overall2.7

Parameters

ParameterDefaultDescription
MM-0.1Deposit percentage or fixed lot; negative = lot size
StopLoss_1000Stop loss in points
TakeProfit_2000Take profit in points
Deviation_10Maximum price slippage in points
BuyPosOpentrueAllow buy position opening
SellPosOpentrueAllow sell position opening
BuyPosClosetrueAllow closing long positions
SellPosClosetrueAllow closing short positions
InpInd_TimeframePERIOD_H4Indicator timeframe
MA_Method1MODE_SMAAveraging method for first smoothing
Length112First smoothing period
Phase115First smoothing parameter (JJMA: -100~+100, VIDYA: CMO period, AMA: slow MA period)
MA_Method2MODE_JJMAAveraging method for second smoothing
Length25Second smoothing period
Phase215Second smoothing parameter
IPCPRICE_CLOSEPrice constant type for indicator calculation
SignalBar1Bar index for entry signal

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.