Trading Systems: Object Approach in MQL

 

New article Object Approach in MQL has been published:

This article will be interesting first of all for programmers both beginners and professionals working in MQL environment. Also it would be useful if this article were read by MQL environment developers and ideologists, because questions that are analyzed here may become projects for future implementation of MetaTrader and MQL.

One of the disadvantages of MQL, in my programmer opinion, is the absence of the object approach in constructing the model of the trading system. MQL developers offer us two ways out: using the calling of external functions or using the order parameter MAGIC for the identification of the order belonging.

Actually, if only one system operates on one account, we do not need identification. But when we have the program option of attaching to one account several automated trading systems, then we cannot do without MAGIC. Even when calling external functions, we need to determine them. Of course, we may build an array OrderTicket and identify the array belonging only to one trading system, but as we know in some brokerage companies the order ticket changes at swap (actually, one is closed, another one is opened). That is why we cannot do without using MAGIC.

So, while developers are busy improving MQL language making it more flexible, let us try to implement already now the object approach in building a trading model.

This is a trading system in accordance with my object model. Of course, it is not universal, but by now I do not see other approaches.

So, let us analyze this model.

A). Signal System (SS).

Object of this module process and interpret incoming quotes. Usually the "object" of the signal system is a set of indicators, for example, moving averages. As a result of processing quotes and indicator values, "the object" (or semaphore) produces signals to enter/exit, or order modification etc.

The semaphore forms its signal and sends it to another object from the module Entry/Exit (EE).

Setting the semaphore in MQL is rather easy.

Author: o_O

 

"And once again I would like to ask MQL developers to widen the options of the language. And as an example, here is a variant of implementing object classes written in the language C++."

I also hope that MQL5 will have some of this features. If events occur also....

 
Can you attach the LaGuerre.mq4? I download the LaGuerre indicator from this site. It get a error "'LaGuerre' - function is not defined ".
 
I presume that the .zip file here contains the Laquerre file.  However, I can't download it.  A square symbol appears next to the file.  Perhaps this is an indication that the file is protected from downloading.  Any help in resolving this will be appreciated.
 
Laguerre.mq4    ??????????????????????????
 
Laguerre.mq4   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Reason: