SelfLearningExperts
This EA uses a self-learning algorithm based on virtual trading to classify binary price patterns and estimate directional probabilities. It tracks price movement patterns across multiple delta parameters, opens virtual positions to learn which patterns predict upward or downward moves, and opens real positions only when the learned probability exceeds a configurable threshold. A forgetting factor ensures the model adapts to changing market conditions over time.
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 online learning of binary price patterns: the direction of recent NN bar price changes is encoded as a 0/1 binary sequence, then converted to a unique pattern number via bit arithmetic. Entry conditions: when the accumulated up-probability (PowerUp) or down-probability (PowerDn) for a given pattern from virtual trading exceeds the Probab threshold (default 0.8), and the virtual trade count for that pattern exceeds 10, a long or short position is opened respectively. Exit conditions include: stop-loss/take-profit hit (equal to the virtual trade stop parameter), probability reversal signals (close when current probability exceeds previously saved probability by 0.05), and partial close signals when profit exceeds half of dstop. Position sizing uses a fixed lot size (Lots parameter), with equal stop-loss and take-profit determined by dstop and Nstop parameters. Money management lacks dynamic position adjustment — no martingale or grid strategies — with only optional trailing stop (Trailing) and stop replacement (ReplaceStops) features.
Strengths
- Self-learning mechanism requires no predefined indicators — automatically discovers effective price patterns through virtual trading
- Forgetting factor (forg) enables adaptation to changing market regimes, preventing stale patterns from interfering
- Multiple delta and stop parameter combinations provide multi-dimensional pattern recognition and risk management
- Probability threshold and minimum trade count requirements filter out low-confidence signals
- Supports saving and loading of learning history for persistent learning across sessions
Weaknesses
- Fixed lot sizing lacks dynamic position management — cannot adjust based on account risk or volatility
- Binary pattern encoding discards price magnitude information, retaining only direction — significant information loss
- Large 3D arrays (5000x30x3) consume substantial memory and most entries may remain unused, causing inefficiency
- Virtual trading evaluates only using Ask price, ignoring spread and slippage effects on actual trading
- File I/O lacks error handling — missing files or read failures can cause crashes
- TimeToUpdate function uses 2x period as cooldown, potentially missing trading opportunities during high volatility
Possible improvements
- Introduce dynamic position sizing based on account equity and ATR volatility for more scientific money management
- Add price magnitude features (e.g., percentage change) on top of binary patterns to improve pattern recognition information content and accuracy
- Add error checking and exception handling for all file operations, and handle missing file scenarios in ReadProbFromFile
Risk assessment
Overall risk: Medium
- File operations lack error handling — corrupted or missing files can cause EA malfunction
- Discrepancy between virtual and real trading due to spread and slippage differences may cause live performance to deviate from learned results
- Fixed lot sizing without risk adjustment may lead to excessive exposure on small accounts or during high volatility
- StopInPointsParameter array size is 3 but Nstop can be set larger, creating potential array out-of-bounds risk
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
ReadHistory | false | Whether to load saved learning history file |
SaveHistory | false | Whether to save learning history periodically and at test end |
Lots | 0.1 | Fixed trading lot size |
Nidelt | 20 | Number of delta parameters for different modes |
Nstop | 1 | Number of SL/TP parameter sets for virtual positions |
dstop | 250 | Stop loss/take profit step change in points |
forg | 1.05 | Forgetting rate, slightly above 1, controls old data decay speed |
Probab | 0.8 | Opening probability threshold; virtual trade probability must exceed this |
NN | 10 | Pattern length (last NN bars), max 12 |
delta | 1 | Step value for pattern parameter delta |
ReplaceStops | false | Replace SL/TP with new signals, only move along position direction |
Trailing | 0 | Trailing stop in points, 0 to disable |
Similar Machine Learning EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.