Optimisation in the Strategy Tester - page 2

 

wrote an EA, ran optimization look, look.... and off... It seems to me that https://www.mql5.com/ru/docs/series Copy... are working slowly.

Документация по MQL5: Доступ к таймсериям и индикаторам
Документация по MQL5: Доступ к таймсериям и индикаторам
  • www.mql5.com
Доступ к таймсериям и индикаторам - Документация по MQL5
 

I'm optimising quickly. I have no complaints. Lately, though, optimization doesn't start right away, but stalls in place (you can hear the disk working hard to do something). I have to jump constantly from one Access Point to another. Only then optimization starts working.

 
gumgum:

and off... It seems to me thathttps://www.mql5.com/ru/docs/seriesCopy... works slowly.

It's not quite clear what you mean by that.

Explain more precisely.

 
gpwr:

I'm optimising quickly. I have no complaints. Lately, though, optimization doesn't start right away, but stalls in place (you can hear the disk working hard to do something). I have to jump constantly from one Access Point to another. Only then optimization starts working.

Would you describe the situation in more detail, if possible? How long do you have to wait for? What (if anything) is written to the logbook?

 
Dmitriy2:

And I selected a few parameters, clicked the test... in the morning I counted the number of runs and how many were left... calculated that there were 50 days to the end of the optimisation... my computer has 4 cores + 2 core agents... I don't need this optimization, so I turned it off...

Try to optimize some parameters first, then others, increase the step. Then you may run it one more time inside the sample.
 
alexvd:

It's not quite clear what you mean.

Explain more precisely.

For example:

double open(string sym,ENUM_TIMEFRAMES tf,int ps)
{
double ren[1]={EMPTY_VALUE};
CopyOpen(sym,tf,ps,1,ren); 
return(ren[0]); 
}

If you ask for the last 50000 values and measure the time to read from the file, the difference is ~0%~30%. 50000 values and measure time, write to file, then measure time to read from file, then the difference is ~0%~30% in favour of the former.

Документация по MQL5: Файловые операции / FileWrite
Документация по MQL5: Файловые операции / FileWrite
  • www.mql5.com
Файловые операции / FileWrite - Документация по MQL5
 
gumgum:

Here's an example:

then the difference is ~0%~30% in favour of the former.

So it reads faster from the file?

Why copy one value at a time when you can copy 50,000 at once (if you have that many)?

 
alexvd:

So it reads faster from the file?

Why copy one value at a time when you can copy 50,000 at once (if you have that many)?

From the file is slower. So why such a difference between "at once 50000" and the last call?

 
gumgum:

So why is there such a difference between "at once 50,000" and the last call?

The arithmetic is simple (the numbers are approximate, but the order of magnitude is important).

Accessing an array element ~ 5 CPU cycles.

The function call is ~100 clock cycles.

This makes the difference that a single function call to get the required amount of data at a time is cheaper in terms of execution speed.

 

The discussion seems to have gone into the specifics of a particular EA's code. But I noticed that almost all time is spent on preparatory work (more than 90%) no matter which EA is optimised. And so it is with every run (pass in the log) with new input parameters being optimized. So no matter how well you optimize your code, you'll get only a couple of percent performance gain.

Toalexvd: Please see the first and third posts of this thread: I've described them in detail with samples and logs.

If a tester could do the preliminary work only once during optimization and then calculate the Expert Advisor enumerating the input data, the optimization time would be at least an order of magnitude shorter. Then we could talk about the Expert Advisor's code itself.

Reason: