MTC Neural Network plus MACD
This EA combines a neural network module with the MACD indicator to generate trading signals. The neural network is trained on historical price data to predict market direction, while MACD serves as a confirmation filter for entry decisions. Trades are opened when both the neural network prediction and MACD signal agree on direction.
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 | -9.20% | -8.05% | 11.07% | 143 | 38.70% | -1.94 | -0.83 | 7 | −$6.72 | Reliable |
| GBPUSD | -11.87% | -10.40% | 14.20% | 142 | 41.50% | -2.06 | -0.84 | 13 | −$8.36 | Reliable |
| USDJPY | -7.93% | -6.93% | 8.96% | 210 | 45.70% | -1.36 | -0.89 | 6 | −$3.78 | Reliable |
| XAUUSD | -31.68% | -27.00% | 92.70% | 151 | 54.30% | 0.51 | -0.34 | 9 | −$20.98 | Reliable |
Profitable on 0 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.
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 15% | +1.47% 2026-01 | -3.20% 2026-08 |
| GBPUSD | 31% | +1.10% 2026-05 | -5.66% 2026-02 |
| USDJPY | 23% | +2.69% 2026-08 | -3.15% 2026-05 |
| XAUUSD | 54% | +239.67% 2026-08 | -57.43% 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 merges machine learning with a classic technical indicator, where the neural network extracts nonlinear pattern features from price sequences and outputs directional predictions, while MACD serves as a traditional momentum confirmation filter to reduce false signals. Entry conditions require alignment between the neural network prediction and MACD histogram direction: a long position is opened when the neural network predicts an uptrend and the MACD histogram is positive, and a short position when it predicts a downtrend with a negative histogram. Exit conditions rely on reverse signal triggers or fixed stop-loss and take-profit levels, with some implementations potentially including trailing stops to protect profits. Position sizing typically uses fixed lots or a percentage-based calculation relative to account balance, though the exact implementation depends on parameter configuration. Money management incorporates mandatory stop-loss settings but may lack dynamic adjustment mechanisms that adapt to current market volatility. The overall strategy attempts to capture nonlinear price patterns through machine learning while using MACD to filter noise, but neural network overfitting risk and retraining frequency are critical concerns that need attention.
Strengths
- Neural network can capture nonlinear price patterns that traditional indicators struggle to identify
- Dual-signal confirmation mechanism (neural network + MACD) reduces the probability of false signal entries
- MACD as a mature indicator provides reliable trend momentum reference
- Parameterized stop-loss and take-profit design enables risk adjustment for different instruments
- Configurable neural network parameters allow optimization of model complexity for different market conditions
Weaknesses
- Neural network is highly prone to overfitting with limited training data; historical performance does not guarantee future returns
- Lacks dynamic stop-loss adjustment mechanism; fixed stop-loss may fail during volatility spikes
- Does not account for spread and slippage impact on scalping-type trades
- Neural network weights may not be persistently stored, requiring retraining on every restart
- Missing money management modules such as maximum drawdown limits or daily loss caps
Possible improvements
- Add file storage and loading mechanism for neural network weights to avoid retraining after restart
- Introduce ATR-based dynamic stop-loss to adapt to market volatility changes
- Add money management rules including maximum drawdown limits and daily maximum loss percentage
Risk assessment
Overall risk: Caution
- Neural network overfitting risk: may perform excellently on training data but suffer severe losses in live trading
- Fixed stop-loss may be gapped through during extreme volatility, causing actual losses far exceeding expectations
- Lack of position consistency checks may cause over-concentration risk when running on multiple instruments simultaneously
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Lots | 0.1 | Fixed lot size per trade |
StopLoss | 50 | Stop loss in points |
TakeProfit | 100 | Take-profit in points (~10 points) |
MACD_FastEMA | 12 | MACD fast EMA period |
MACD_SlowEMA | 26 | MACD slow EMA period |
MACD_SignalSMA | 9 | MACD signal SMA period |
NN_Inputs | 10 | Neural network input layer nodes |
NN_Hidden | 5 | Neural network hidden layer nodes |
NN_LearningRate | 0.01 | Neural network learning rate |
NN_TrainingBars | 1000 | Historical bar count for neural network training |
TrailingStop | 0 | Trailing stop in points; 0 to disable |
MagicNumber | 123456 | EA magic number for order identification |
Similar Machine Learning EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.