
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
That's what I'm looking for. But the problem is that the optimisation passes are done at startup, so you can get potentially billions of passes that shouldn't be run. I would love to find a way to filter out/update the bad passes before the testing starts. it's not a case of the lookup table to filter out unwanted combinations, it's a problem where duplicated results are returned for multiple passes when the critreria for the pass shouldn't be considered. I get that you are trying to help, and I've tried all the avenues that I can think of. if i could find a way to read in a lookup table with the combinations, then that would be ideal. But the current functionality of the ParameterSetRange, does not allow that. Unless there's another method i can use to manually set the parameters i want to test.
I think this usecase falls outside the current capability of metatrader. Let me be clear, i'm not saying Metatrader is bad, it's just this usecase, where I want to remove the ability for the optimising parameters to be running passes when it's going to have no material impact on the results, is missing.
Another simple way, is to simple test the combinations in the OnInit() function and if they are to be discarded, then simply return INIT_PARAMETERS_INCORRECT, and that pass will not be run.
INIT_PARAMETERS_INCORRECT
Designed to denote an incorrect set of input parameters by a programmer. In the general optimization table, the result string with this return code is highlighted in red.
A test for such a set of EA inputs is not performed. The agent is ready to receive a new task.
When this value is received, the strategy tester does not pass this task to other agents for repeated execution.
Another simple way, is to simple test the combinations in the OnInit() function and if they are to be discarded, then simply return INIT_PARAMETERS_INCORRECT, and that pass will not be run.
INIT_PARAMETERS_INCORRECT
Designed to denote an incorrect set of input parameters by a programmer. In the general optimization table, the result string with this return code is highlighted in red.
A test for such a set of EA inputs is not performed. The agent is ready to receive a new task.
When this value is received, the strategy tester does not pass this task to other agents for repeated execution.
yeah I do use that, but that's only if very specific conditions for failure are met. I still want tests to run where the data is valid, but i don't want it to run if the outcome has no effect on disabled parameters. Your previous example is perfect.
You are overcomplicating it again. This method is still useful for that.
For example, assume a MA cross with a fast and slow period where I optimise both periods from 1 to 200. I use this method to filter out all combinations where the "slow" period is not greater than the "fast" period, which drastically reduces the number of combinations tested.
Not really, the case you mention does work, however, assume you have 3 indicators:
MACD
MA Trend
MA Cross
Just because the criteria for the MACD is invalid, does not mean I don't want to still run the test when the MA Trend and MA Cross criteria is valid. Furthermore, according to the documentation, when ~500 passes return 0 or has initialisation failures, then the entire optimisation is stopped.
Not really, the case you mention does work, however, assume you have 3 indicators:
MACD
MA Trend
MA Cross
Just because the criteria for the MACD is invalid, does not mean I don't want to still run the test when the MA Trend and MA Cross criteria is valid. Furthermore, according to the documentation, when ~500 passes return 0 or has initialisation failures, then the entire optimisation is stopped.
Fair enough, then use the lookup method, especially if you plan to use the faster genetic optimisations.
I have never had need to discard so many, but out of curiosity where in the documentation is that ~500 mentioned?
By the way, there is also another method using the OnTesterInit() to auto generate parameter ranges. See the following ...
By the way, there is also another method using the OnTesterInit() to auto generate parameter ranges. See the following ...
The 500 number was an arbitrary number i've seen when running optimisations, but this forum references that too many invalid parameters cause failures New Version of MetaTrader 5 Platform build 1860: Functions for Working with Bars in MQL5 and Improvements in the Strategy Tester - General Discussion - MQL5 Algo Traders Forum - Page 14. WRT the ParameterSetRange, i have tried that and you will see that i have referenced it in the start of my thread. It doesn't quite work because the passes are generated onTestInit, unless my understanding is incorrect and that it generates it on every pass. but i could not get the behaviour i wanted. maybe i'll revisit it.
By the way, there is also another method using the OnTesterInit() to auto generate parameter ranges. See the following ...
woohoo i got the params working. it's doing what i want now. thanks all.
woohoo i got the params working. it's doing what i want now. thanks all.
spoke too soon. it doesn't work as intended.
But I'm still getting:

instead of 0 where the signal is false. Furthermore when i start the genetic optimisation, in the journal I can only see the following being printed once.
What I'm expecting is that the input param is calculated and set per pass. It would've been really helpful to have a method that's callable by the optimiser before a test, similar OnTester. Some like OnBeforeTester where you are able to set the input parameters.
I always approached similar scenarios using INIT_PARAMETERS_INCORRECT inside the OnInit and nothing else.
So let's assume in my EA, I've got a section for 2 indicators:
Indicator A:
bool enabledA = true|false
int periodA = 1-200
indicator B:
bool enabledB = true|false
int periodB = 1-200
In this case, when you have disabled indicator A, it will run only the first pass of your optimization, same for indicator B. But it's very similar of what Alain already suggested.