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
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.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
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | -0.1 | Deposit percentage or fixed lot; negative = lot size |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum price slippage in points |
BuyPosOpen | true | Allow buy position opening |
SellPosOpen | true | Allow sell position opening |
BuyPosClose | true | Allow closing long positions |
SellPosClose | true | Allow closing short positions |
InpInd_Timeframe | PERIOD_H4 | Indicator timeframe |
MA_Method1 | MODE_SMA | Averaging method for first smoothing |
Length1 | 12 | First smoothing period |
Phase1 | 15 | First smoothing parameter (JJMA: -100~+100, VIDYA: CMO period, AMA: slow MA period) |
MA_Method2 | MODE_JJMA | Averaging method for second smoothing |
Length2 | 5 | Second smoothing period |
Phase2 | 15 | Second smoothing parameter |
IPC | PRICE_CLOSE | Price constant type for indicator calculation |
SignalBar | 1 | Bar index for entry signal |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.