Discussion of article "Library for easy and quick development of MetaTrader programs (part XXIX): Pending trading requests - request object classes"

 

New article Library for easy and quick development of MetaTrader programs (part XXIX): Pending trading requests - request object classes has been published:

In the previous articles, we checked the concept of pending trading requests. A pending request is, in fact, a common trading order executed by a certain condition. In this article, we are going to create full-fledged classes of pending request objects — a base request object and its descendants.

In the three previous articles, we checked the concept of managing trading methods of the trading class using pending requests.
A pending request is, in fact, a common trading order executed by a certain condition. We checked the condition of delaying sending a trading order in trading methods when receiving the server error whose handling requires some waiting before resending the request to the server. Naturally, these are not all the conditions, under which pending requests can be used. Conditions may also include price levels, upon reaching which a trade order is sent. It may also be a combination of conditions, for example, some threshold values of symbol properties. Upon reaching these values, a trading order is sent to the server (a stop limit order is a good example of a pending trading request for placing a limit order when the price reaches a stop order level).

In general, pending trading requests allow us to create some kind of behavior logic for sending trading orders to the server.
However, in order to fit all this to the pending request object code, we need it to conform the general concept of library objects. This makes objects easily extensible in order to insert new properties into them. At the current stage, the code for handling pending trading requests is located directly in the trading class listing. This is done purely to check the concept and is conceptually incorrect for further use. I have done this on purpose in order to quickly check everything before wrapping the construction into the correct form.
In the current article, we are going to create the base class of the abstract pending trading request object and the descendant object classes of the base request object. The base object is to contain properties that are common for all property request objects, while the descendant objects contain individual properties native to the status of each child object. This is done to all library objects and the current case is no exception.

Author: Artyom Trishkin

Artyom Trishkin
Artyom Trishkin
  • www.mql5.com
Trader's profile