Skip to content
All library documents

A Self-Learning Expert Advisor Based on Price-Pattern Statistics

Article MQL5 code base

Summary

This Expert Advisor builds several price patterns at different historical depths from tick movements. It encodes each pattern as a binary sequence according to whether each sampled price rose or fell, then tracks virtual trades for pattern configurations and stop-loss/take-profit distances. Once a configuration has at least 10 virtual deals, the advisor may open a position in the direction supported by its estimated up-or-down probability. It supports up to three virtual position settings, with equal stop-loss and take-profit distances for each setting.

The guide describes collecting and saving learning history, optimizing parameters, and using tester data before running the advisor on a demo account. It cautions that learning can take weeks and that tester tick behavior may differ considerably from live markets; results should therefore be checked in demo trading. Timeframe affects learning-save frequency and the minimum spacing between virtual deals, so behavior can vary across timeframes. No quantified performance evidence is presented, and the proposed workflow does not establish live profitability.

Key ideas

  • The advisor encodes rising and falling price sequences into binary pattern identifiers.
  • It estimates directional probabilities from virtual trades associated with patterns and stop-loss/take-profit settings.
  • A configuration needs at least 10 virtual deals before it can inform a live position decision.
  • The guide recommends optimizing parameters, saving learned history, and checking behavior on a demo account.
  • Tester tick changes may differ from live prices, and the learning process may take weeks.

Tags

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