is it possible detect the begin and end of optimizer from code? - page 2

 
VabRus:


You can send mail with a extern dll.

I don´t understand how you get that output to file.

iOptimization in your code don´t change his value and must be 1 and iDeInit_Count = 1 is normal because this variable is destroyed in every init();

iDeInit_Count was always 0 when it starts a new optimization because its just a global_variable. The external variable incremented by 1 on each run. The file just got over written every_time and I ended up with the last result.
 
ubzen:
iDeInit_Count was always 0 when it starts a new optimization because its just a global_variable. The external variable incremented by 1 on each run. The file just got over written every_time and I ended up with the last result.


"The external variable incremented by 1 on each run."

Special Global Variable can be incremented by each deinit(), external variable and simple global variable is destroyed too.

How can I know when is the first pass and the last pass in a optimization with only code.

 
VabRus: "The external variable incremented by 1 on each run." Special Global Variable can be incremented by each deinit(), external variable and simple global variable is destroyed too.

extern  int iOptimization=1;

void init(){}
void start(){}

void deinit(){
    int H=FileOpen("iOptimization.csv",FILE_CSV|FILE_READ|FILE_WRITE,',');
    FileSeek(H,0,SEEK_END);
    FileWrite(H,"iOptimization="+iOptimization);
}
How can I know when is the first pass and the last pass in a optimization with only code.
From the responses you're getting, I don't think you can. Perhaps you could problem_solve it within a dll. Good Luck.
 
ubzen:

From the responses you're getting, I don't think you can. Perhaps you could problem_solve it within a dll. Good Luck.


Sorry man, I didn´t undestand you, my english is very bad...

For this output result you are optimizer with iOptimization between 1 - 6

 
RaptorUK:
If you know the number of passes . . . you could increment a counter in a GlobalVariable which you have manually reset to zero before starting the optimization run.


I was determined to do it manually, but I think is not possible know the number of pass until the tester finished.

The number of passes that is indicated in Settings of the Tester is only approximate.

 
VabRus:


Sorry man, I didn´t undestand you, my english is very bad...

For this output result you are optimizer with iOptimization between 1 - 6

Its ok.
 
VabRus:


I was determined to do it manually, but I think is not possible know the number of pass until the tester finished.

The number of passes that is indicated in Settings of the Tester is only approximate.

It shouldn't be approximate unless you have Genetic Algorithm ticked . . . but it's not an idea solution, if the Tester event handlers make their way from MT5 to the new MT4 you will be able to use OnTesterDeinit() in future.
 
RaptorUK:
It shouldn't be approximate unless you have Genetic Algorithm ticked . . . but it's not an idea solution, if the Tester event handlers make their way from MT5 to the new MT4 you will be able to use OnTesterDeinit() in future.


Yes, I hope the new MT4 solve this problems.
 
VabRus: Yes, I hope the new MT4 solve this problems.
Don't hold your breath because there is no problem. The optimizer runs and stops. You've created the problem because YOU want to do something different on the last run. Why didn't you think about my suggestion. https://www.mql5.com/en/forum/148418
 
WHRoeder:
Don't hold your breath because there is no problem. The optimizer runs and stops. You've created the problem because YOU want to do something different on the last run. Why didn't you think about my suggestion. https://www.mql5.com/en/forum/148418


Yes, I am greatful for your post, but maybe I don´t think run with me, I need activate genetic algorithm sometimes.

Sorry maybe you have the solution for me but I haven´t seen how can I detect the start and stop of the tester.