Calling optimizer from within EA-code (MT4)

 

Hi,

 with the code

// Start Tester 
start = ShellExecuteA(0, "Open", "terminal.exe", FileOptim, PathTester, 3);

 I can call a second MT4 instance and start the tester with pre-defined optimization settings.

This principle is described in this article. I tried it and it works fine.

But!

How can I start the optimizer of the MT4 instance, where my EA is running? Means I don't want to start a second MT4 instance. 

Does anybody know the necessary command?

 

Thanks!

Squib 

 
Squib: How can I start the optimizer of the MT4 instance, where my EA is running? Means I don't want to start a second MT4 instance. 
Why not? Optimization takes time. Do you really want to stop the current EA and wait for the optimization to complete?
 
WHRoeder:
Why not? Optimization takes time. Do you really want to stop the current EA and wait for the optimization to complete?

No, the EA continues in parallel. I just check from the EA whether the report file is finished. Then I know, that optimization has finished and I take the parameter out of the report file. 
 
WHRoeder:
Why not? Optimization takes time. Do you really want to stop the current EA and wait for the optimization to complete?

And it's not just for optimizing the parameter of a specific EA from within the EA. I like the idea to have full control over the optimization itself.  So you could control from a script, indicator or EA the optimization of a strategy, do customized walk-forward tests, change optimization parameter depending on the result of a finished optization, create your own criterias for walk forward tests...
Reason: