Discussion of article "Creating Multi-Expert Advisors on the basis of Trading Models"

 

New article Creating Multi-Expert Advisors on the basis of Trading Models is published:

Using the object-oriented approach in MQL5 greatly simplifies the creation of multi-currency/multi-system /multi-time-frame Expert Advisors. Just imagine, your single EA trades on several dozens of trading strategies, on all of the available instruments, and on all of the possible time frames! In addition, the EA is easily tested in the tester, and for all of the strategies, included in its composition, it has one or several working systems of money management.

Author: Василий Соколов

 

 Hallo. Respekt for this great Tutorial.Verry big praise at you.

I've debugged this Code and find an error at Line 355 in Model.mqh
   

switch(op_type)
 {
 case ORDER_TYPE_BUY:
 case ORDER_TYPE_SELL:
 rez=m_trade.PositionOpen(m_symbol,op_type,lot_send,price,0.0,0.0,comment);
 break;

under ORDER_TYPE_BUY: is none Funktion.Is that right?No function by Buy?
I've changed the code in:

   
switch(op_type)
 {
 case ORDER_TYPE_BUY:
 rez=m_trade.PositionOpen(m_symbol,op_type,lot_send,price,0.0,0.0,comment);
 break;
 case ORDER_TYPE_SELL:
 rez=m_trade.PositionOpen(m_symbol,op_type,lot_send,price,0.0,0.0,comment);
 break;


But, in Jornual you see, he hasn't long Position only short.


ea_modelclass



I don't find the error.need Help.


MfG Christian

Files:
logfile.txt  100 kb
 

Compliments for this article!!

I am glad more people thing about this idea. Once before a time I tryied to develop multicurrency multistrategy EA template in MQL4

Since MQL5 is here I was trying to design object model of such an EA and to start implement it

Unfortunatelly no free time for these activities... :-(

please keep on this project...that is the way I think... to have a framework, where it is possible to implement easily a lot of strategies and with possibility to switch on/off any of them, manually or even automatically. So we can have a portfolio of EA's and even add or remove some EA's if it is required.

Thanks for this!! 

PS: here is a link if you would be interested in...

https://www.mql5.com/en/forum/118148 

Cooperation on interesting projects: TRENDLINE AUTOTRADER and UNIVERSAL MULTICURRENCY MULTISTRATEGY TRADER TEMPLATE - MQL4 forum
  • www.mql5.com
Cooperation on interesting projects: TRENDLINE AUTOTRADER and UNIVERSAL MULTICURRENCY MULTISTRATEGY TRADER TEMPLATE - MQL4 forum
 

The scope of this article is vast and *very* well thought out.

I can't tell you in words how much I appreciate your efforts on building this framework; you also explained the reasoning behind your approach to an understandable level (at least to me!). This article goes much further than concepts, I agree - this is practical, proper, most importantly prudent application of trading and OO programming techniques!

A request - can your comments in the english files be translated? Further, can somebody direct me to tools for further working with Russian language? The comments in MetaEditor do not even appear as Russian language, rather as garbled accented characters not much different from this example:

 // Èíèöèàëèçèóðóåì óêàçàòåëü ìîäåëüþ MACD

I have been using Chrome+Google Translate to view the Russian site for some time now, but on longer articles (especially this one) I can only get a finite length of the document translated. I was very anxious to read in full depth this article and had to wait some time, which, to me at least, was hardly tolerable! Any advice on becoming more foreign-language-friendly will be accepted with high regard!

A masterpiece, Mr. Sokolov. My compliments and gratitude I send to you for your work, and I look forward to implementing my visions for this great approach to trading systems. You have solved many conflicts I had while trying to design a system which might handle my requirements of the system I ultimately want to trade. For the remaining problems yet to be resolved, this framework leads my efforts in the right direction by design. 

 

chr1sch4n:    There is no error...  your code you've re-written is identical. 

In C language,  case statements fall through, which is why you have to put in the break statement, so therefore the Buy should fall through to the next statement and still execute the order.

refer: http://en.wikipedia.org/wiki/Switch_statement  ;    section C, C++, Java, PHP, ActionScript, JavaScript;   "this is a classic example of omitting the break line to allow for fall through"

 

cheers

 

 

 
Lugner:

A request - can your comments in the english files be translated?

Fixed. Thank you.
 
One of the best articles I have read, Thank you very much. 
 

I dont seem to get the impressive backtest shown in the article.  what are the settings I need to do?

 

Hi,

how can I enhance model or Processing() function to support pair trading (another symbol)? Now everything works with indicator and subsequent trading on the same Symbol only. How can I add Symbol1 and Symbol2 to be able to buy Symbol1 and sell Symbol2 simultaneously?

Thanks for help

P.S.: Or buy/sell Symbol1 based on behavior of indicator on Symbol2...

 
P_Cherry:

Hi,

how can I enhance model or Processing() function to support pair trading (another symbol)? Now everything works with indicator and subsequent trading on the same Symbol only. How can I add Symbol1 and Symbol2 to be able to buy Symbol1 and sell Symbol2 simultaneously?

Thanks for help

P.S.: Or buy/sell Symbol1 based on behavior of indicator on Symbol2...

I hope it is possible?
 
Automated-Trading:
Fixed. Thank you.
thanks.
Reason: