Not for MT developers! What to replace INIT_PARAMETERS_INCORRECT with ?

 

I've encountered this problem: According to the logic of the program, there is a need to sift out invalid function calls. I use INIT_PARAMETERS_INCORRECT for this. But the genetic optimization stops practically at once. Developers get angry with questions concerning this situation. They advise to study genetic analysis and so on and so forth.

But what for do I need it? I, as a user, want to get results and I don't care about how it works.

So, here is an example on three functions 1, 2 and 3. 0 is not to be used.

In a chain, functions must not repeat and there must not be a 0 between functions (otherwise there may be repetitions).

An example of allowable chains:

  • 100
  • 120
  • 130
  • 123
  • 132
  • 2..
  • 3..

Example of unacceptable chains:

  • 010
  • 001
  • 110
  • 101
  • 111
  • 121
  • 122
  • 131
  • 133
  • 112
  • 113
  • 102
  • 103
  • 2..
  • 3..
As you can see, there are an order of magnitude more invalid chains than valid chains. How to perform a sampling? How to replace INIT_PARAMETERS_INCORRECT ? Where do I dig?

 
Cancel calculations in On-functions if parameters are left-handed. Runs will be slower thanINIT_PARAMETERS_INCORRECT, but not significantly.
 
How's that? Can I give you a tiny example?
 

Could you be more explicit about possible sets of input parameters, undesirable sets, and why there are too many undesirable sets ?

I fully agree with the developers that there should not be too many undesirable sets. The optimum is no more than 10%.

 
Сергей Таболин:
How's that? Can I give you a tiny example?

fxsaber is right.

If incorrect set of parameters is input - you return all OnTick() functions at once. And onTester - you return the minimum result.

 
Сергей Таболин:
How's that? Can I give you a tiny example?
input int i = 0; 

bool Incorrect;
 
int OnInit()
{
  Incorrect = !i; // нулевое значение считается некорректным (пример)
  
//  return(Incorrect ? INIT_PARAMETERS_INCORRECT : INIT_SUCCEEDED); // Было
  return(INIT_SUCCEEDED);
}

void OnTick()
{
  if (Incorrect)
    return;
    
  // ...
}
 
These are not sets of input parameters! They are a set of functions which must not be repeated! In slow optimization, INIT_PARAMETERS_INCORRECT really helps to build valid chains for calling these functions, but I have 6 of them. I have 117649 chain variants. But these chains are useless without some input parameters. With them, we already have over 38,000,000 ! There is no way around it with slow brute force.
 
Сергей Таболин:
These are not sets of input parameters! It's a set of functions that must not be repeated! In slow optimization INIT_PARAMETERS_INCORRECT really helps to build valid chains for calling these functions, but I have 6 of them. I have 117649 chain variants. But these chains are useless without some input parameters. With them, we already have over 38,000,000 ! There is no way around it with slow brute force.

Genetics will die because the optimization surface of the optimization criterion should be more or less continuous (smooth). In your case, however, you get a huge number of spikes (failures).


You can set the following experiment. Take the standard Expert Advisor and add some additional parameters for optimization there - fake ones. Making 90% of their sets INCORRECT. GA will die. Although it will do pretty well without fake parameters.

 
fxsaber:

Got it. It's just a question of selecting the right functions and their order in the optimiser. And manually write all the irrelevant chains.... And how will the optimizer find them then?

 
fxsaber:

Genetics will die because the optimization surface of the optimization criterion should be more or less continuous (smooth). In your case, however, you get a huge number of spikes (dips).

I understand this. I do not understand only how to get around it?

 
Сергей Таболин:

I understand that. What I don't understand is how to get around it?

One recipe is for developers to treat the result of INCORRECT passes as the nearest previously calculated CORRECT pass. This will even out the holes in the optimization surface.

Reason: