Discussion of article "Library for easy and quick development of MetaTrader programs (part XXX): Pending trading requests - managing request objects"

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

New article Library for easy and quick development of MetaTrader programs (part XXX): Pending trading requests - managing request objects has been published:

In the previous article, we have created the classes of pending request objects corresponding to the general concept of library objects. This time, we are going to deal with the class allowing the management of pending request objects.

Initially, I wanted to make an independent class for managing pending requests featuring all the necessary methods. But it turned out that the main CTrading class of the library and the created new class of managing pending requests are so interrelated that it would be much easier to let the new class for managing pending request objects be the descendant of the main trading class.

The entire management of pending request objects is performed in the class timer, therefore we make the base trading class timer virtual, which means the timer of the pending request management class is to be virtual as well. Then everything that relates to the base trading class timer is set in the class timer, while everything that should work in the class for managing pending request objects is set in the timer of that class.

Apart from the class for managing pending request objects, we are going to create a small class to arrange a pause to avoid using the Sleep() function which stops the program execution for a delay time. With the pause object, we will no longer depend on ticks which means we will be able to test a code requiring waiting on weekends. The pause is to be controlled in the timer.

Author: Artyom Trishkin

To add comments, please log in or register