Skip to content
All library documents

Real-Time Expert Advisor Optimization with Indicator-Based Testing

Article MQL5 articles

Summary

The document describes an approach to refreshing Expert Advisor parameters while a market is running. An indicator reproduces the EA’s trading rules, tracks virtual trades, and tests multiple parameter sets in parallel. The EA reads each tester indicator’s statistics and selects settings when its entry criteria are met. The example strategy combines WPR and RSI signals with ADX to identify ranging conditions, then uses fixed stop-loss and take-profit levels and allows only one open position at a time.

The author reports a profitable test over the analyzed period, with an actual profit factor of 1.66, and notes that visual testing used 1250 MB of RAM. These results are specific to the described setup and do not establish performance across markets or periods. The approach estimates history from M1 OHLC data, checks stop loss before take profit, and opens trades at candle boundaries, so its virtual results may differ from tick-level execution. Running many indicators also creates CPU and memory demands, while collecting enough live data takes time.

Key ideas

  • An indicator can simulate an EA and track virtual trades for multiple parameter sets in parallel.
  • The EA can select parameters based on each indicator’s recent profitability statistics.
  • The example uses WPR and RSI entries filtered by ADX, with fixed exits and one position at a time.
  • M1 OHLC assumptions simplify historical calculations but can differ from real tick execution.
  • The method trades faster re-optimization against data-collection time and terminal resource use.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.