Skip to content
All library documents

Structuring Reusable MQL5 Libraries for Trading Tools

Article MQL5 articles

Summary

This installment describes organizing MQL5 code for projects that use a shared Expert Advisor library. It recommends keeping each project in its own repository and placing each dependency in an Include folder as a separate repository clone. A shared library is maintained in its own repository with development and main branches, while project work proceeds on separate branches. Relative include paths make the library usable from different folder locations, and changes to a dependency can be developed and merged independently.

The example project is a symbols informer intended to collect statistics on runs of consecutive candles across instruments and timeframes. Such information could help define sensible parameter ranges before optimization and assess whether those ranges transfer across symbols. The provided excerpt focuses mainly on repository and project setup; it does not include complete informer results or evidence that the approach improves trading performance. Its contribution is a development workflow and a rationale for using descriptive market statistics to guide optimization.

Key ideas

  • Separate repositories for projects and reusable libraries reduce code duplication and version conflicts.
  • Keep library dependencies inside each project's Include folder as distinct repository clones.
  • Use relative include paths so a library can be built from different project locations.
  • A symbols informer can summarize consecutive same-direction candle runs by instrument and timeframe.
  • Descriptive statistics may help narrow optimization ranges, though the excerpt provides no performance evidence.

Tags

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