Discussing the article: "The MQL5 Standard Library Explorer (Part 1): Introduction with CTrade, CiMA, and CiATR"

 

Check out the new article: The MQL5 Standard Library Explorer (Part 1): Introduction with CTrade, CiMA, and CiATR.

The MQL5 Standard Library plays a vital role in developing trading algorithms for MetaTrader 5. In this discussion series, our goal is to master its application to simplify the creation of efficient trading tools for MetaTrader 5. These tools include custom Expert Advisors, indicators, and other utilities. We begin today by developing a trend-following Expert Advisor using the CTrade, CiMA, and CiATR classes. This is an especially important topic for everyone—whether you are a beginner or an experienced developer. Join this discussion to discover more.

While the MQL5 documentation provides the formal definition of classes like CTrade, CiMA, and CiATR—listing their inheritance, available methods, and brief descriptions—it stops short of showing developers how to combine them into practical trading systems. For a newcomer, this gap can be intimidating; the docs tell you what exists, but not how to use it effectively. That is why our discussion and many other articles are crucial.

Here we go beyond the API listings and step into application. We explain not only what each class represents, but also how to integrate it within the Expert Advisor lifecycle, how its outputs should be interpreted, and how it interacts with other classes to form a complete strategy. In short, this series bridges the gap between reference documentation and real-world practice, giving readers a guided path from raw class definitions to a working trading robot.

Why these classes?

The MQL5 Standard Library is bundled with every MetaTrader 5 installation, and its source files are readily accessible in MetaEditor 5. By default, these files are located under the Include directory of your MQL5 installation (for example, MQL5\Include\Trade\ or MQL5\Include\Indicators\). Each module is organized into header files (.mqh) that define reusable classes such as CTrade, CiMA, and CiATR. In MetaEditor, you can easily browse these files from the Navigator panel under Include → Standard Library, or open them directly via File → Open. This accessibility means you are free to use the classes in your projects by adding #include statements, and also to inspect the source code itself, learn how the library is structured, and even extend or customize it for your own development needs

ShareX_fVhTmSxwMI

Author: Clemence Benjamin