Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1439

 
mwwm #:

Yes exactly, in order to reduce the number of combinations and optimisation time

When initialising, exclude ranges from optimisation explicitly or via a formula, then the pass will be terminated at initialisation, which will reduce the optimisation time.

int OnInit()
{

   if(Stop_Test_P>(Total_Test_P+N_Test_P*K_Test_P+K_Test_P))return(INIT_PARAMETERS_INCORRECT);

   return(INIT_SUCCEEDED);
}
Not recommended for genetics.
 
Aleksey Vyazmikin #:

When initialising, exclude ranges from optimisation explicitly or via formula, then the pass will terminate at initialisation, reducing the time to optimise.

Not recommended for genetics.

Is initialisation called for each pass? Not clear how to get all variable values and the number of passes is not a constant, oversorting, etc. From xml csv file, but how in the optimisation process is not clear.

 
mwwm #:

Is initialisation called for each pass?

Sure.

mwwm #:

Not clear how to get all variable values and the number of passes is not a constant, re-sorting, etc. From xml csv file, but how in the optimisation process is not clear.

And during optimisation you can use the file - I don't understand the thought process.

 
Aleksey Vyazmikin #:

Of course.

And when optimising you can use the file - I didn't understand the train of thought.

Just when optimising on all cores, you need your own file in a separate folder on the disc, 16 cores 16 files? It is at a single run it is clear where the file is located and read.

 
mwwm #:

Just when optimising on all cores, the file needs its own file in a separate folder on the disc, 16 cores 16 files? It is at a single run it is clear where the file is located and read.

You need one file.

You make a reference to it in the code

#property tester_file"PredFind\\Pred_Brut\\Test_Pred.csv"; 

and read it as usual during initialisation.

 
Aleksey Vyazmikin #:

I need one file.

Make a link to it in the code

and read it as usual during initialisation.

It is not clear how to compare combinations from OnStart with combinations from OnInit. Or is there some way to get them directly from the optimisation process?

 
mwwm #:

It is not clear how to compare combinations from OnStart with combinations from OnInit. Is there any way to get them directly from the optimisation process?

All comparisons in OnInit should be made. Directly - only after optimisation by saving to a file... Or you can calculate the number of combinations yourself and not use them.

 
Aleksey Vyazmikin #:

All comparisons should be made in OnInit. Directly - only after optimisation by saving to a file.... Or calculate the number of combinations yourself and do not use them.

Alexey, is it okay that OnInit() doesn't exist in scripts?

Forum on trading, automated trading systems and testing trading strategies.

Questions from MQL5 MT5 MetaTrader 5 beginners

mwwm, 2023.01.31 16:01

It is not clear how to compare combinations from OnStart with combinations from OnInit. Is there any way to get them directly from the optimisation process?

And judging by the question, the conversation is about a script... Or are you discussing with a person who does not even understand the difference between Expert Advisors and scripts?
 
Alexey Viktorov #:

Alexey, is it okay that OnInit() doesn't exist in scripts?

And judging by the question, the conversation is about a script... Or are you discussing with a person who doesn't even understand the difference between Expert Advisors and scripts?

I think OnTick was meant.

 
Aleksey Vyazmikin #:

I think what OnTick meant was.

Yeah, that's right, it's blurry.

Reason: