Download MetaTrader 5
To add comments, please log in or register
Publish your task in Freelance service and developers will execute your order.
MetaQuotes Software Corp.
Moderator
180293
MetaQuotes Software Corp. 2011.01.18 13:20 

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: Василий Соколов

chr1sch4n
16
chr1sch4n 2011.01.21 02:11  

 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
slacktrader
392
slacktrader 2011.01.25 22:50  

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
Brett Luedtke
114
Brett Luedtke 2011.01.29 08:54  

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. 

n2535904
118
n2535904 2011.01.31 10:39  

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

 

 

Automated-Trading
Admin
97621
Automated-Trading 2011.02.01 18:19  
Lugner:

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

Fixed. Thank you.
NFTrader
597
NFTrader 2011.04.18 13:08  
One of the best articles I have read, Thank you very much. 
williamwong
631
williamwong 2011.08.05 17:37  

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

P_Cherry
97
P_Cherry 2012.01.16 17:11  

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
97
P_Cherry 2012.01.23 14:50  
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?
supercoder2006
26
supercoder2006 2012.08.01 23:41  
Automated-Trading:
Fixed. Thank you.
thanks.
/ /12
To add comments, please log in or register