Discussion of article "Adaptive Trading Systems and Their Use in the MetaTrader 5 Client Terminal"

 

New article Adaptive Trading Systems and Their Use in the MetaTrader 5 Client Terminal is published:

This article suggests a variant of an adaptive system that consists of many strategies, each of which performs its own "virtual" trade operations. Real trading is performed in accordance with the signals of a most profitable strategy at the moment. Thanks to using of the object-oriented approach, classes for working with data and trade classes of the Standard library, the architecture of the system appeared to be simple and scalable; now you can easily create and analyze the adaptive systems that include hundreds of trade strategies.

Figure 2. Equity curves at the account with the adaptive strategy that uses signals of 10 trade systems

Author:  MetaQuotes

 
Thank you. It's a good article. Will save me a lot of time.
 
Yes, good article, and I could use it.
 

No words, thank you

Entered my trading strategy.

Who can tell me how to work with this error?

Error when creating indicators 4002

although the actual error code 4002 is:

ERR_WRONG_INTERNAL_PARAMETER 4002 Error parameter at internal call of client terminal function.

or did it occur simply because I launched the Expert Advisor outside the terminal's working hours?

and how to avoid errors when creating indicators? There are a lot of questions (.

Please tell me how to solve this problem, if it is not too difficult. In what place of the code to look for this error? At least approximate reference points.

The answer, of course, lies on the surface, but the trick is that I am not a programmer.


P.S.: Come to think of it, the error first disappeared after I changed the type of the variable avdeals int to double in the


double CSampleStrategy::StrategyPerformance()

but then it happened again and the EA crashed as well.

 
Please provide the source code. You can do it via the servicedex on this site.
 

In the CAdaptiveStrategy class I try to trade only stochastics:

// create 5 trading strategies CStrategyStoch (stochastic trading)
// initialise them, set parameters
// and add to the m_all_strategies container
    for(int i=0; i<5; i++)
     {
      CStrategyStoch *t_StrategyStoch;
      t_StrategyStoch=new CStrategyStoch;
      if(t_StrategyStoch==NULL)
        {
         delete m_all_strategies;
         printf("Error creating an object of type t_StrategyStoch");
         return(-1);
        }
      //set the period of each strategy
      int Kperiod=2+i*5;
      int Dperiod=2+i*5;
      int Slowing=3+i;
      // strategy initialisation
      t_StrategyStoch.Initialization(Kperiod,Dperiod,Slowing,true);
      // set strategy information
      string s=IntegerToString(Kperiod)+"/"+IntegerToString(Dperiod)+"/"+IntegerToString(Slowing);
      t_StrategyStoch.SetStrategyInfo(_Symbol,"[Stoch_"+s+"]",100+i," Stochastic "+s);
      //add the strategy object to the array of objects m_all_strategies
      m_all_strategies.Add(t_StrategyStoch);
     }
I disabled the rest, but the chart in the tester is still the same. As far as I understand, this is where strategies are connected and disconnected?
 

The article is good, but purely speculative. Well, let's say, a demonstration of MQL5 capabilities.

It is obvious that trading on already lagging indicators (they are all like that) and choosing the best one for a certain period (+ more lag) will not help you achieve anything.

 

Impressionant article.

Thanks. I love this new mql5 forum, and it seems becoming a kind of science.

Your article is great, and is something i was looking for years, thanks for helping me indirectly.


I also should warn that there is an(logically insignificant) error in the include file CSampleStrategy,

//+------------------------------------------------------------------+
//| The StrategyPerformance function of effectiveness of strategy    |
//+------------------------------------------------------------------+ 
double CSampleStrategy::StrategyPerformance()
  {
//returns the effectiveness of strategy
/in this case it's the difference between the amount 

 the last raw have only one slash on the comment and this generate about 13 errors when compiling the mq5 expert.


This is a very great article, that combined with many other articles knowledge in the last months of mql5 can make a very interesting

experimentations on high-grade experts advisors.


I was wondering about the possibility to improve this article-strategy, in example by adding files possibility

to the code, to store and recall extra results.. The fantasy would not stop.

Thanks again.

 

PS: it also produce to me an "internal error #55"

that don't let the ex5 being created. Some helps.. ?

 
forexistence:

I also should warn that there is an(logically insignificant) error in the include file CSampleStrategy,

 the last raw have only one slash on the comment and this generate about 13 errors when compiling the mq5 expert.


Thank you. The corrected version is reattached to the article.
 

Thanks for the corrected version.

I think a thing: even if this article is very interesting, the idea is very great, the code is very clean and with many advantages,

and even if this is an example EA, the whole EA as published is Strategy Tester unfriendly.

I mean the fact that with the downloaded version is not possible to set input parameters from the terminal.

 

Since include files cannot have input parameters variables, how the way to "inputize" the many variables of the many include files

of this EA?