AdaptiveTrader_Pro_Final_EA
This EA uses RSI overbought/oversold signals confirmed by dual-timeframe moving average trend filters to enter trades on M5 charts. It features adaptive parameter optimization via brute-force backtesting, ATR-based position sizing and trailing stops, and dynamic risk adjustment based on historical win rate. The system periodically re-optimizes its RSI period, ATR multiplier, and trailing stop/TP multipliers.
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 | — | — | — | — | — | No trades |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | No trades |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | No trades |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | No trades |
Why this EA never traded: its entry needs a signal and an extreme oscillator reading on the same bar, which did not happen in one year of hourly data.
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 a mean-reversion approach with multi-timeframe trend confirmation, using RSI on M5 to identify overbought/oversold zones while requiring price to be on the same side of both M5 and H1 SMAs for entry. Buy condition requires RSI below 30 and price above both M5 and H1 SMAs; sell condition requires RSI above 70 and price below both SMAs. Exit conditions include fixed ATR-multiplier-based stop loss and take profit, plus a three-tier progressive trailing stop — when unrealized profit exceeds 2x ATR the stop moves to price-1.5x ATR, above 1x ATR it moves to price-1x ATR, otherwise it maintains a 0.5x ATR distance. Position sizing calculates lot size by dividing account balance times risk percentage by the ATR-based stop loss distance in points, respecting the symbol's minimum/maximum volume and volume step constraints. Money management dynamically adjusts risk percentage every 4 hours based on each symbol's win rate — reducing by 0.05% when win rate falls below 40% and increasing by 0.05% when above 60%, capped at the initial maximum risk. Additionally, the system performs brute-force parameter optimization every hour, iterating through RSI period and ATR multiplier combinations to find the best parameter set.
Strengths
- Multi-timeframe trend confirmation (M5+H1) reduces counter-trend trading risk
- ATR-based dynamic position sizing and stop loss adapts risk to market volatility
- Dynamic risk percentage adjustment based on historical win rate provides adaptive risk control
- Spread filter and news avoidance mechanism prevent entries during unfavorable market conditions
- Indicator handles are properly released in OnDeinit, avoiding resource leaks
Weaknesses
- The BacktestWithParameters function is a stub placeholder returning 0, making parameter optimization completely ineffective as all parameter combinations score identically
- ApplyTrailingStop does not iterate through positions — it calls PositionGetInteger without first selecting a position via PositionSelect, resulting in incorrect or undefined position data
- The tradeActive flag is set to true on entry but never reset to false on exit, meaning each symbol can only ever open one trade and then becomes permanently blocked
- BreakEvenMultiplier and PartialTakeProfitPercent parameters are declared but never used anywhere in the code logic
- The IsHighImpactNewsUpcoming function is a placeholder always returning false, making the news avoidance feature completely non-functional
- OnTick calls LogInfo on every tick, which produces massive redundant logs on liquid instruments and impacts performance
Possible improvements
- Implement actual backtesting logic or use MQL5's OnTester framework so parameter optimization produces meaningful results; alternatively, remove the optimization feature to avoid misleading users
- Use PositionSelect or iterate through all positions in ApplyTrailingStop to correctly select the position for each symbol, and reset tradeActive to false when positions are closed
- Implement the actual logic for BreakEvenMultiplier and PartialTakeProfitPercent, or remove these unused parameters to reduce confusion
Risk assessment
Overall risk: Medium
- Parameter optimization is completely non-functional (stub backtest), potentially misleading users into believing parameters are optimized while using defaults
- tradeActive never resets causing symbol lockout, but before lockout the flawed trailing stop logic may modify the wrong position's stop loss
- No new bar detection means signal checks and stop modifications run every tick, potentially opening multiple trades on the same bar or excessively modifying stops
- Stop loss and take profit use ATR absolute values rather than points, without considering symbol quote precision, which may result in unreasonable stop distances
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MaxRiskPercent | 0.2 | Risk percentage per trade |
OptimizationInterval | 3600 | Parameter optimization interval (seconds) |
InpMagicNumber | 121300 | EA trading magic number |
MaxSimultaneousTrades | 1 | Maximum simultaneous open trades |
TrendPeriod | 20 | M5 timeframe trend MA period |
BreakEvenMultiplier | 1.5 | ATR multiplier to move SL to breakeven |
PartialTakeProfitPercent | 0.5 | Position ratio to close at first TP level |
PerformanceCheckInterval | 14400 | Performance check interval (seconds) |
MaxSpreadPoints | 20 | Maximum allowed spread for opening positions |
NewsAvoidanceMinutes | 30 | Avoidance time around high-impact news (minutes) |
HigherTimeframe | PERIOD_H1 | Timeframe for higher-TF trend confirmation |
HigherTimeframeTrendPeriod | 50 | Higher timeframe trend MA period |
RSI_Min_Period | 8 | RSI optimization minimum period |
RSI_Max_Period | 14 | RSI optimization maximum period |
ATR_Min_Multiplier | 1.0 | ATR multiplier optimization minimum value |
ATR_Max_Multiplier | 2.0 | ATR multiplier optimization maximum value |
TrailingStop_Min_Multiplier | 1.0 | Trailing stop multiplier optimization minimum |
TrailingStop_Max_Multiplier | 2.0 | Trailing stop multiplier optimization maximum |
TrailingTP_Min_Multiplier | 1.0 | Trailing TP multiplier optimization minimum |
TrailingTP_Max_Multiplier | 2.0 | Trailing TP multiplier optimization maximum |
Similar Multi-Timeframe EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.