Discussion of article "Library for easy and quick development of MetaTrader programs (part II). Collection of historical orders and deals"

To add comments, please log in or register
MetaQuotes
Moderator
222428
MetaQuotes  

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.

Collection of historical orders and deals

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

KjLNi
7
KjLNi  

Hello, there is a compilation error in the object 

HistoryDeal.mqh

line 37


it says that 

ORDER_PROP_STATE is an "undeclared identifier".

Artyom Trishkin
Moderator
60691
Artyom Trishkin  
KjLNi :

Hello, there is a compilation error in the object 

HistoryDeal.mqh

line 37


it says that 

ORDER_PROP_STATE is an "undeclared identifier".

What version of library are you using?

What version of test adviser are you using?

KjLNi
7
KjLNi  
Artyom Trishkin:

What version of library are you using?

What version of test adviser are you using?

Hello Artyom, thanks for your reply.

In the first step, I had copied the program from the forum here.

I did not have compilation errors until then.

In the next step, I have used the file which is attached here, but it has produced the same error.

Is there another place where I can find an "up to date" version?

thanks in advance, and your work and help here is highly appreciated!


Artyom Trishkin
Moderator
60691
Artyom Trishkin  
KjLNi :

Hello Artyom, thanks for your reply.

In the first step, I had copied the program from the forum here.

I did not have compilation errors until then.

In the next step, I have used the file which is attached here, but it has produced the same error.

Is there another place where I can find an "up to date" version?

thanks in advance, and your work and help here is highly appreciated!


1. Delete the entire folder from the data location of your terminal MQL5\Include\DoEasy\ (delete only DoEasy - Do not delete Include!)

2. Copy the DoEasy folder from the zip files attached to this article to Include\. This guarantees you version 2 of the library for the test advisor, which is in the files of this article.

3. Use the Expert Advisor file located in the zip-files attached to this article for testing - from the Experts\TestDoEasy\Part2\ location

The latest version of the library is here (russian):

Библиотека для простого и быстрого создания программ для MetaTrader (Часть XXXI): Отложенные торговые запросы - открытие позиций по условиям
Библиотека для простого и быстрого создания программ для MetaTrader (Часть XXXI): Отложенные торговые запросы - открытие позиций по условиям
  • www.mql5.com
При проектировании функционала библиотеки была запланирована концепция торговли при помощи отложенных запросов, в которую входят два варианта работы — обработка ошибок торгового сервера и обычная отсылка торговых приказов по программно заданным условиям.  В предыдущих статьях, начиная со статьи 26, мы шаг за шагом создали обработку ошибок...
To add comments, please log in or register