New article Library for easy and quick development of MetaTrader programs (part II). Collection of historical orders and deals has been published:
In the first part, we started creating a large cross-platform library simplifying the development of programs for MetaTrader 5 and MetaTrader 4 platforms. We created the COrder abstract object which is a base object for storing data on history orders and deals, as well as on market orders and positions. Now we will develop all the necessary objects for storing account history data in collections.
It is always helpful to have the account history at hand. The
terminal provides it and gives the tools to get it in programs. However,
our current tasks require a custom list we are able to sort and
re-arrange to return necessary data to our programs. This means the
change of the previous account history status should be checked at each
tick. If a change is detected, the list of historical orders and deals
is to be recalculated. But sorting the entire history at each tick is
too resource-intensive. Therefore, we will only make additions to our
list of new data, while previous data is already stored in the list.
Let's create the new class CHistoryCollection in the Collections folder:
Right-click on the Collections folder, select "New File", select "New Class" in MQL Wizard window and click Next. Enter CHistoryCollection class name, leave the base class field blank and click Finish.
Author: Artyom Trishkin