You have the wrong topic. You are concentrating on optimisation, while the problem is obviously with the EA(parameter transfers etc). Forget about the optimisation for a while, put comment's and printers in the EA, run with different parameters in the visual, controlling the intermediate data, find all the errors, and then go back to the optimisation.
The same results indicate that the optimised parameters do not affect the formation of the trading signal, and this is the problem of the EA, not the tester.
If I set the parameters like this: (iCustom(NULL, 0, "ART", MA_Period, KFK, 0, 1), Digits); - all zeros appear, as I gave an example above.
If I set iCustom(NULL, 0, "ART", 0, 1), Digits); - then calculated values appear,
but they are all the same, although in the tester, when running with different parameters, the results of the trades are very different.
Angela, for optimization to work, you have to use the values changed by the optimizer in the algorithm somehow, in particular you have to pass them to the indicator. It is necessary to pass parameters to the indicator, if you want to optimize it. When you call the indicator without parameters (i.e. the second case iCustom(NULL, 0, "ART", 0, 1)), you actually omit the parameters and it works with the default ones, that are registered inside ART (of course they aren't optimized). The full call with parameters - the first option - is what you need for optimization. Most likely, the problem is that you don't pass parameters correctly. For example, if their number in the indicator is less, and you pass a better value, or vice versa, if you don't give them all parameters. If the indicator is a secret, at least give the list of its parameters.
Congratulations. I also remember struggling with passing parameters, until I got used to being scrupulous. Now I copy a piece of indicator code with all externs into Expert Advisor and write iCustom, looking at the sample. It is a bit obtuse, but since then there are no errors.
And one more thing. I have looked up komposter's illustrative style of writing iCustom. Everything is right in the palm of my hand.
/*
Входные параметры индикатора
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
*/double signal=iCustom(Symbol(),Period(),"MACD",
FastEMA,//параметр 1
SlowEMA,//параметр 2
SignalSMA,//параметр 30,//номер буфера индикатора
SignalBar);//бар, с которого получаем данные (внешняя переменная)
I am debugging the second version of my TS, in comparison with the first one the number of deals has increased and the number of optimizable parameters has decreased significantly, although the drawdown has doubled.
However I have some doubts, the system is not very stable from month to month. I have not optimized it yet but the result with GA will be available in 48 hours. 800+ runs are not encouraging and optimization results in June are worse than those of testing with the initial parameters for the same period. I bring three stats, for June, July and August, so far I've debugged only Buy. Can I pull such a system out due to optimization with stable results or should I start to develop a new one right away?
If only the mql-code is involved in the EA, then something must be coded wrong, because with the opening price model 800 runs should not be so slow. Or maybe I misunderstood something. Usually experts with external binding such as neural network libraries, etc. are so slow. Of course, we can also assume that mql has a lot of nested loops (or calls of some "voracious" indicators) - then it may be completely slowed down. Therefore, I can only repeat the idea of the supposed need for refactoring ;-) - Re-check and re-transform some code fragments or the whole code.
marketeer писал(а)>> If only mql-code is involved in Expert Advisor, something must be incorrectly coded there because 800 runs should not slow down at opening prices. Or am I misunderstanding something. Usually experts with external binding such as neural network libraries, etc. are so slow. Of course, we can also assume that mql has a lot of nested loops (or calls of some "voracious" indicators) - then it may be completely slowed down. Therefore, I can only repeat the idea of the supposed need for refactoring ;-) - Re-check and re-transform some code fragments or the whole code.
800 out of more than 8000 runs had passed by the time of writing the post, with 5 hours of optimization, and there was still 2 days to go. But I didn't wait until the end, reduced the enumeration range of some parameters, restarted and in 8 hours the whole optimization went through.
The number of profitable trades exceeds the number of losing trades, the average profitable trade more than the losing one is a very good sign. In my opinion, you should not give up on this system, you should study its behaviour on a longer period. You can also put it on another cross.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
So only this iCustom line is changed? Then we need to look at this indicator in detail.
You have the wrong topic. You are concentrating on optimisation, while the problem is obviously with the EA(parameter transfers etc). Forget about the optimisation for a while, put comment's and printers in the EA, run with different parameters in the visual, controlling the intermediate data, find all the errors, and then go back to the optimisation.
The same results indicate that the optimised parameters do not affect the formation of the trading signal, and this is the problem of the EA, not the tester.
If I set the parameters like this: (iCustom(NULL, 0, "ART", MA_Period, KFK, 0, 1), Digits); - all zeros appear, as I gave an example above.
If I set iCustom(NULL, 0, "ART", 0, 1), Digits); - then calculated values appear,
but they are all the same, although in the tester, when running with different parameters, the results of the trades are very different.
Angela, for optimization to work, you have to use the values changed by the optimizer in the algorithm somehow, in particular you have to pass them to the indicator. It is necessary to pass parameters to the indicator, if you want to optimize it. When you call the indicator without parameters (i.e. the second case iCustom(NULL, 0, "ART", 0, 1)), you actually omit the parameters and it works with the default ones, that are registered inside ART (of course they aren't optimized). The full call with parameters - the first option - is what you need for optimization. Most likely, the problem is that you don't pass parameters correctly. For example, if their number in the indicator is less, and you pass a better value, or vice versa, if you don't give them all parameters. If the indicator is a secret, at least give the list of its parameters.
Thanks to everyone, the reason was trivial. The order in which the parameters sent from the indicator to the EA did not match:
in the Expert Advisor was
extern int MA_Period=151; // 101 10 201
extern double KFK=0.9; // 0.7 0.005 1.
in the indicator on the contrary
extern double KFK=0.9; // 0.7 0.005 1.
extern int MA_Period=151; // 101 10 201
it worked in the visualization mode, but not in the optimization mode.
Congratulations. I also remember struggling with passing parameters, until I got used to being scrupulous. Now I copy a piece of indicator code with all externs into Expert Advisor and write iCustom, looking at the sample. It is a bit obtuse, but since then there are no errors.
And one more thing. I have looked up komposter's illustrative style of writing iCustom. Everything is right in the palm of my hand.
I am debugging the second version of my TS, in comparison with the first one the number of deals has increased and the number of optimizable parameters has decreased significantly, although the drawdown has doubled.
However I have some doubts, the system is not very stable from month to month. I have not optimized it yet but the result with GA will be available in 48 hours. 800+ runs are not encouraging and optimization results in June are worse than those of testing with the initial parameters for the same period. I bring three stats, for June, July and August, so far I've debugged only Buy. Can I pull such a system out due to optimization with stable results or should I start to develop a new one right away?
If only mql-code is involved in Expert Advisor, something must be incorrectly coded there because 800 runs should not slow down at opening prices. Or am I misunderstanding something. Usually experts with external binding such as neural network libraries, etc. are so slow. Of course, we can also assume that mql has a lot of nested loops (or calls of some "voracious" indicators) - then it may be completely slowed down. Therefore, I can only repeat the idea of the supposed need for refactoring ;-) - Re-check and re-transform some code fragments or the whole code.
800 out of more than 8000 runs had passed by the time of writing the post, with 5 hours of optimization, and there was still 2 days to go. But I didn't wait until the end, reduced the enumeration range of some parameters, restarted and in 8 hours the whole optimization went through.
Best result:
The number of profitable trades exceeds the number of losing trades, the average profitable trade more than the losing one is a very good sign. In my opinion, you should not give up on this system, you should study its behaviour on a longer period. You can also put it on another cross.