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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear Forexistence,
You have answered your question :)
You are right, there are two ways if you want to modify trading conditions, from one side we can add new conditions to strategy CStrategyMA (but we will get the new strategy, different from the initial), the other way is to create a new class (for example, CStrategyMA34) and add additional buy/sell conditions there.
But of course, you should include file with your new strategy and add these new strategies to the Expert_OnInit function of CAdaptiveStrategy class:
The second way is better, you can add many strategies and their variations.
It isn't necessary to remove the CStrategyMA class instances (if you have ones), we will not look in their sandboxes in their results will be bad.
The market will help us to determine the best strategy in the list of strategies, included in m_all_strategies.
Dear Forexistence,
>>Dear
You have answered your question :)
>> Yes, maybe partly i've answered my question myself, and just want a confirmation or different opinions.
You are right, there are two ways if you want to modify trading conditions, from one side we can add new conditions to strategy CStrategyMA (but we will get the new strategy, different from the initial), the other way is to create a new class (for example, CStrategyMA34) and add additional buy/sell conditions there.
But of course, you should include file with your new strategy and add these new strategies to the Expert_OnInit function of CAdaptiveStrategy class:
The second way is better, you can add many strategies and their variations.
It isn't necessary to remove the CStrategyMA class instances (if you have ones), we will not look in their sandboxes in their results will be bad.
The market will help us to determine the best strategy in the list of strategies, included in m_all_strategies.
>> Ok got the point as i imagined.
But the question, now, is another.. I'm working to "inputize" the EA for the goal to work with optimizations.
So in example i mean pieces of codes like this:
where (declarations) :
and where variables:
RSItempoframe, RSIappprice, RSIvarA_root, RSIvarB_root
work in collaboration with
My question is:
It's opportune to modify the code, in order to have input variable AT strategy classfile (include file i.e CStrategyRSI.mqh) level , or with the proper hiearachy/connections/trees AT the other class/includes level (CAdaptiveStrategy.mqh) ?
In other words, for affecting the core system of the EA idea, with the adding of some input parameters for optimizations testing,
i should do something like this : (input variables in CAdaptiveStrategy.mqh)
or some other like this: (input variables in CSampleRSI.mqh)
In other more words, input variables should be used in the strategy include file, before class declaration (example2, just this above here) or input variables should
derive from the "for" cicle in the CAdaptive strategy, and should take consideration of all classes initializazion and input parameters? (i mean for this first example(just above this code above) :)
public:
// initialization of strategy
int Initialization(int period,bool virtual_trade_flag,ENUM_TIMEFRAMES RSItempoframe,
ENUM_APPLIED_PRICE RSIappprice,int RSIvarA_root, int RSIvarB_root);
How differently will affect the core of the system, if using input variables in the CStrategyRSI.mqh file or in the CAdaptiveStrategy.mqh?
I suppose, if just a matter of testing, i can use input variables in the CStrategyRSI.mqh, if instead i want both testing and also
affecting the core system of the EA idea (the adaptive system and trade simulator, the virtual trader include) i should declare
input variables not in the strategy include, but in the Adaptive include file, with all proper connections and calling
of input/output of the inizialization and declaration of class/functions?
Right?
I hope you got my point.
Tnkx
....But the question, now, is another.. I'm working to "inputize" the EA for the goal to work with optimizations....
If you want to find best parameters of the strategy using optimization option in the Strategy Tester, it's better to rewrite the EA with some particular strategy and play with it.
The concept of the adaptive EA and its structure doesn't allow to optimize its parameters in Strategy Tester directly, because there isn't any particular strategy and parameters to optimize.
When we use the adaptive EA in trading or testing it in Strategy Tester we have a trading system as a set of signals from the different strategies. In other words, the Tester cannot access to the virtual sandboxes we created and it doesn't know anything about them.
If you want to use the input parameters to configure the parameters of trading strategies to use, it's better to use the files, it will allow you to configure the parameters and list of trading strategies.
If you want to find best parameters of the strategy using optimization option in the Strategy Tester, it's better to rewrite the EA with some particular strategy and play with it.
>> Ok, i got the point. It will be not an easy task..
The concept of the adaptive EA and its structure doesn't allow to optimize its parameters in Strategy Tester directly, because there isn't any particular strategy and parameters to optimize.
>> Yes. The EA is idealized to work with still-optimized parameters for the strategies. What i've understood is that it utilizes different strategies in basis how/which the market respond (or vice versa on another point of view..)
When we use the adaptive EA in trading or testing it in Strategy Tester we have a trading system as a set of signals from the different strategies. In other words, the Tester cannot access to the virtual sandboxes we created and it doesn't know anything about them.
>> Understood this concept, but not completely.
I understand that have no sense to interact the tester with virtual sandboxes, no trading logical sense.
My only goal were to have the EA modified, in order to use it with an addon: the objective of using this EA also for optimizing parameters, without rewrite another EA, or rewrite all the strategies, or testing each strategies individually. My idea were only for "comfort" to the possibility to optimize the parametes, within the same EA, but this optimization is not intended to work with the virtual trade / adaptive system. It's just a matter of have the possibility to optimize the parameters of the strategies, using the same EA input window, and not to write another each EA for each strategy, get the optimize parameters, and put them as fixed values into the Adaptive Strategy System. I hope you got my point.
If you want to use the input parameters to configure the parameters of trading strategies to use, it's better to use the files, it will allow you to configure the parameters and list of trading strategies.
>> Which files you are talking about? ( If you want to use the input parameters to configure the parameters of trading strategies to use, it's better to use the files )
Are you talking about to use CStrategyXXX.mqh or the fact to write another individual EA for each strategy, optimize it, and copy the parameters as fixed values in CStrategyXXX.mqh?
Are you talking about to use CStrategyXXX.mqh or the fact to write another individual EA for each strategy, optimize it, and copy the parameters as fixed values in CStrategyXXX.mqh?
I mean that strategy container can be filled according some settings of the adaptive EA.
For example, in the Adaptive_Expert.Expert_OnInit() it may load a file with adaptive EA settings:
MA;15
MA;25
Stoch;3;12;20
Stoch;3;15;30
Strategy1;Param1;Param2;
Strategy2;Param1;Param2;
By parsing each line it recognizes the strategy needed to include and add it with corresponding parameters specified. It's one of the ways to configure the adaptive EA without compilations. For the simplicity, I haven't considered it in the article.
I understand that have no sense to interact the tester with virtual sandboxes, no trading logical sense.
My only goal were to have the EA modified, in order to use it with an addon: the objective of using this EA also for optimizing parameters, without rewrite another EA, or rewrite all the strategies, or testing each strategies individually. My idea were only for "comfort" to the possibility to optimize the parametes, within the same EA, but this optimization is not intended to work with the virtual trade / adaptive system. It's just a matter of have the possibility to optimize the parameters of the strategies, using the same EA input window, and not to write another each EA for each strategy, get the optimize parameters, and put them as fixed values into the Adaptive Strategy System. I hope you got my point.
There is a way to look at the sandboxes. It can be done indirectly using the Strategy Tester.
Suppose that we want to reproduce the results, presented at fig. 2 of the article.
We need the debug version of the adaptive EA adaptive-systems-mql5-sources-debug-en.zip (it report the sandboxes) The next, compile and open Adaptive_Expert_Sample in Strategy tester, select EURUSD H1 01.01.2010 to 20.08.2010 and start testing. The sandboxes and the adaptive strategy results will be saved in tester\files\equity_res.txt Using this way it's very easy to reproduce all the figures.
The analysis of the virtual trading equities/balances will allow you to simplify the optimization.
Hello everyone,
Thanks for this great article, I am now only working on an adaptive EA.
However, I am not sure where to include a trailing stop function in this kind of EA.
I think such a function could be added in the CAdaptiveStrategy.mqh part.
Could any of you provide me with some help? Maybe you guys already have developed such a function?
Thank you very much in advance!
Best regards,
Patrick
I can't reproduce the results in the article.
Downloaded the source files, compiled, and ran over the same timeframe (EURUSD H1, 04/01/2010 - 20/08/2010) and I get a different result.
I used the debug files and checked the virtual trading ouputs . . . the virtual equity graphs are identical, however, the actual trades do not match.
Without a log file of the actual trades it's hard to find why my trades don't match the article's.
Any idea why I don' match?