Skip to content
All library documents

Modeling Historical Orders and Deals in a MetaTrader Library

Article MQL5 articles

Summary

This installment develops a cross-platform MetaTrader library for representing account history. It extends a common order object with separate classes for historical market orders, removed pending orders, and deals, so each object can identify its type and expose the properties it supports. The article describes passing a ticket and status into each class and overriding property-support methods where a historical object does not provide particular fields.

It then applies these objects within collections of historical orders and deals and updates related enumerations and property descriptions. The material is mainly a software design guide, with implementation examples and compilation-oriented explanations; it does not offer a trading method or empirical performance results. The author characterizes the library as a beta under active development, so interfaces and behavior may change. Its relevance to quantitative trading is practical: structured history objects can make account data easier for later filtering, selection, and analysis, but this article leaves those downstream uses to subsequent development.

Key ideas

  • A shared order base class can support distinct objects for historical orders, pending orders, and deals.
  • Each derived class can declare which properties are valid for its object type.
  • Tickets and object status identify the account-history records represented by the classes.
  • Collections provide a structured way to store historical orders and deals for later operations.
  • The library is presented as a beta, so its implementation may change.

Tags

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