Exp_XMACD
This EA trades based on the XMACD custom indicator, offering four distinct signal modes: zero-line breakthrough, MACD direction change, signal line direction change, and MACD-signal line crossover. It opens and closes positions according to the selected mode with configurable money management, stop loss, and take profit settings.
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 | — | — | — | — | — | Run error |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
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
This EA implements a momentum-based strategy using the XMACD indicator, which is an extended version of the traditional MACD supporting multiple smoothing algorithms (SMA, EMA, JJMA, JurX, etc.) and various price types. The strategy offers four entry modes: the zero-line breakthrough mode trades when the MACD histogram crosses zero; the MACD twist mode trades when the MACD changes direction; the signal line twist mode trades when the signal line changes direction; and the MACD crossover mode trades when the MACD histogram crosses the signal line, which is the most classic MACD trading approach. Exit conditions include closing positions on reverse signals, fixed stop loss, and take profit levels. Position sizing is controlled via the MM parameter, where negative values represent fixed lot sizes and positive values represent a percentage of the deposit. The strategy uses an IsNewBar mechanism to prevent repeated trading within the same bar and employs a Recount flag to recalculate signals when data copying fails.
Strengths
- Offers four trading modes providing high strategic flexibility to adapt to different market conditions
- Uses IsNewBar mechanism to prevent repeated trades within the same bar, reducing overtrading
- Supports multiple smoothing algorithms and price types, making XMACD more powerful than standard MACD
- Provides granular permission controls for buy/sell opening and closing positions independently
- Fixed stop loss and take profit settings provide defined risk management
Weaknesses
- No trailing stop mechanism, profits may be reduced by market retracements
- No spread filter, potentially generating false signals in high-spread environments
- The MM parameter design where negative values mean fixed lots is unintuitive and error-prone
- Lacks position checking logic before opening trades, risking duplicate positions
- Depends on external iCustom indicator, the EA will fail if the XMACD indicator file is missing
Possible improvements
- Add a trailing stop feature to lock in more profits during trend continuation
- Add spread filter and maximum position check to improve trading robustness
- Redesign the MM parameter using an enum to distinguish between fixed lot and percentage modes, eliminating the confusing negative value convention
Risk assessment
Overall risk: Medium
- No position count check, potentially opening duplicate positions in the same direction
- Fixed stop loss/take profit values are large (1000/2000 points), allowing significant per-trade losses
- Depends on external custom indicator; when missing, only a warning is printed but the EA continues running
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | -0.1 | Trade volume ratio; negative=fixed lot, positive=deposit percentage |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Max price deviation (slippage tolerance) in points |
BuyPosOpen | true | Allow buy position open |
SellPosOpen | true | Allow sell position open |
BuyPosClose | true | Allow close long positions |
SellPosClose | true | Allow close short positions |
Mode | MACDdisposition | Entry algorithm: zero-line breakout / MACD reversal / signal line reversal / MACD crossover |
InpInd_Timeframe | PERIOD_H4 | Arrows_Curves indicator timeframe |
XMA_Method | MODE_EMA | MACD histogram smoothing method |
Fast_XMA | 12 | Fast moving average period |
Slow_XMA | 26 | Slow moving average period |
XPhase | 100 | Smoothing parameter, JJMA range -100 to +100 |
Signal_Method | MODE_SMA | Signal line smoothing method |
Signal_XMA | 9 | Signal line period |
Signal_Phase | 100 | Signal line smoothing parameter |
AppliedPrice | PRICE_CLOSE_ | Price constant type |
SignalBar | 1 | Bar index for entry signal |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.