Discussion of article "An attempt at developing an EA constructor"

 

New article An attempt at developing an EA constructor has been published:

In this article, I offer my set of trading functions in the form of a ready-made EA. This method allows getting multiple trading strategies by simply adding indicators and changing inputs.

The EA created by the constructor immediately features multiple settings, which can be combined to create unique strategies. The version 4.XXX applies the following rules: 

  • the current symbol is used (a symbol of the chart the EA is launched on)
  • Take Profit, Stop Loss and Trailing are set in Points in the inputs. Points — current symbol point size in the quote currency, for example for 'EURSD' 1.00055-1.00045=10 points.

The 'points' can always be seen on the symbol chart by dragging the Crosshair tool:

points

Fig. 1. Points

Author: Vladimir Karputov

 
I don't see any attachments. Just one.
 
Andrei Novichkov #:
I don't see any attachments. Just one.

Technical hitch. They'll be up in a bit.

 

Good afternoon, thanks for the article, but I have a question:)

Why not use a standard class and load it with additional functions, because it is as simple and convenient as possible, rather than inventing your own bicycle?

 
Daniil Kurmyshev #:

Good afternoon, thanks for the article, but there is a question :)

Why not use a standard class and load it with additional functions, because it is as simple and convenient as possible, rather than inventing your own bicycle?

And you probably tried to supplement CExpert yourself and you even succeeded?

 
Vladimir Karputov #:

And you probably tried to supplement CExpert yourself and you even succeeded?

Yes, here is an example of how you can by inheriting from the base class CExpert , in a new class CExpertCustom:

1. The possibility to supplement positions with new deals (multi-trade) is realised.

Since the base class has virtual functions, they were overridden in the descendant class and hidden from further use in future inheritance classes from CExpertCustom.

2. The possibility to change the base symbol of the Expert Advisor has been implemented, which makes it possible to create multicurrency Expert Advisors

Bottom line:

The standard CExpert class has a high speed of operation

It is as reliable and tested as possible

It is easy to supplement and maintain

It is possible to create a multicurrency Expert Advisor in one bot by inheriting from the new CExpertCustom class.

Due to the fact that the standard class actively uses inheritance and polymorphism, it is possible to create Expert Advisors that work according to completely different logic, but their processing and sequence for basic functions will be the same.

In this case, the constructor of Expert Advisors can be used according to the template from the terminal with the necessary indicators and MM...

Files:
 
Daniil Kurmyshev #:

Yes, here is an example of how you can by inheriting from the base class CExpert , in a new class CExpertCustom:

1. The ability to supplement positions with new trades (multitrade) is implemented

Since the base class has virtual functions, they were overridden in the descendant class and hidden from further use in future CExpertCustom inheritance classes.

2. The possibility to change the base symbol of an Expert Advisor is implemented, which makes it possible to create multicurrency Expert Advisors

Bottom line:

The standard CExpert class has a high speed of operation

Maximum reliability and proven

It is easy to supplement and maintain

It is possible to create a multicurrency expert in one bot if you inherit from the new CExpertCustom class.

Due to the fact that the standard class actively uses inheritance and polymorphism, it is possible to create Expert Advisors that work according to completely different logic, but their processing and sequence for basic functions will be the same.

In this case, the constructor of Expert Advisors can be used according to the template from the terminal with the necessary indicators and MM...

CExpert and everything generated by it has not been tested for a long time. That's why we made our own set of trading functions: with a lot of checks. The class shown by you does not have a fraction of the functionality of my approach.

 
Vladimir Karputov #:

CExpert and everything generated by it has not been checked for a long time. That's why I made my own set of trading functions: with many checks. The class shown by you does not have even a fraction of the functionality of my approach.

The standard libraries you used:

#include <Trade\PositionInfo.mqh>

#include <Trade\Trade.mqh>

#include <Trade\SymbolInfo.mqh>

#include <Trade\AccountInfo.mqh>

#include <Trade\DealInfo.mqh>

#include <Trade\OrderInfo.mqh>

#include <Expert\Money\MoneyFixedMargin.mqh>

Your functional file "Trading engine 4" uses exactly the same libraries as in the CExpert class, it's just that you wrote the processing yourself for theTradeclass, and the checks and similar mechanics you developed are already implemented in the CExpertBase, CExpertTrade and otherclasses...., that's what I'm talking about, that's why I'm talking about creating another bicycle, because you could rework the CExpert class to make it pass the check, if for some reason it didn't pass, if you did it once, you wouldn't have this problem anymore.

I think that you have a good set of basic functions that are very difficult to work with if you use them in a large project, but copying functions from your donor project into your own, many people will like it very much, but it will be hard to use the whole class, unlike the CExpert class, which is easy to deploy out of the box, through the same "MQL Wizard", which is mentioned in the article.

 
Congratulations on the excellent article.
The files of this article are not attached to the reading terminal, only "Indicators_Code.mq5".

Could you add to the article please!?

Thanks! (Sorry for my English)
 
Archived in files:
Files:
9717_411.zip  56 kb
 
Vladimir Karputov #:
Archive in files:

Hi Vladimir,

I have a question about "Pending Orders" and the corresponding "Maximum Spread" parameter in the 4.004 trading engine;


How long does this function wait for pending orders to be placed before the corresponding spread is reached?

In other words, if the spread does not decrease to the specified value after a certain period of time, won't the pending order be cancelled? How does this cycle work?