ea_template.mq5
This EA is a neural network-based trading template from the NeuroNetworksBook collection. It uses a feedforward neural network to generate trading signals based on price and indicator inputs, applying trained weights to predict market direction for automated trade execution.
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
- Has no stop loss or trailing stop
On its own this is not a typical blow-up pattern, 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 a feedforward neural network that takes price data and technical indicators as input layer features, processes them through hidden layer activation functions, and outputs trading signals. Entry conditions are determined by the neural network output, opening long positions when the output exceeds a set threshold and short positions when it falls below a negative threshold. Exit conditions include take-profit and stop-loss settings as well as closing positions when the neural network generates a reverse signal. Position sizing uses either fixed lot sizes or dynamic lot allocation based on account equity percentage. Money management provides a risk percentage parameter to control the maximum loss per trade but lacks equity drawdown protection mechanisms.
Strengths
- Neural network can capture non-linear market patterns, more adaptive than traditional technical indicators
- Template design allows users to easily modify network structure and parameters based on needs
- Combines technical indicators with price data as input features for rich information dimensionality
- Provides configurable risk percentage parameter with basic money management framework
- Clear code structure separating network training from trade execution logic
Weaknesses
- Neural network weights depend on historical training data and may fail when market structure changes, lacking online learning mechanism
- No overfitting detection or validation mechanism, trained model may perform drastically differently in live trading vs backtesting
- No spread filter, news filter, or trading session restrictions, will still open positions in adverse market conditions
- Stop-loss and take-profit use fixed pip settings without dynamic adjustment based on ATR or other volatility indicators
- Lacks position check and duplicate entry protection, may open multiple positions on the same signal
Possible improvements
- Add online learning mechanism so the neural network can dynamically adjust weights based on real-time market data
- Introduce spread filter and trading session controls to avoid trading during high spread and low liquidity periods
- Use ATR for dynamic stop-loss and take-profit adjustment instead of fixed pip settings
Risk assessment
Overall risk: Medium
- Neural network model may overfit historical data leading to poor live performance
- No spread filter or trading session control, trades even in adverse conditions
- Fixed pip stop-loss does not account for market volatility changes, may be too wide in low volatility and too tight in high volatility
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
LotSize | 0.1 | Fixed lot size per trade |
StopLoss | 500 | Stop loss in points |
TakeProfit | 1000 | Take profit in points |
RiskPercent | 2.0 | Risk percentage per trade relative to balance |
NN_Threshold | 0.6 | Neural network signal threshold for opening positions |
HiddenLayers | 1 | Number of hidden layers |
NeuronsPerLayer | 10 | Number of neurons per layer |
LearningRate | 0.01 | Neural network learning rate |
InputWindow | 20 | Input data window size |
MagicNumber | 123456 | EA order identification number |
Similar Machine Learning EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.