Change inputs of black box EA programmatically

 
Hello experts,

I'm wondering if it is possible to write a script/EA which will make edits to a loaded EA without removing it and reloading it.

The EA is compiled and I do not have access to the source code.

The only way to adjust the settings is via the GUI dialog box (right-click window -> expert advisors -> properties). 

I would like to be able to make changes via external script which will basically emulate the dialog box behavior. Not through mouse clicks and keyboard but via the script itself.

Any insight would be helpful
 
No.
 
Marco vd Heijden:
No.
Very definitive.

Alternatively... since the changing of input vars via dialog box triggers a deinit and init call. Is there any difference between that and re-attaching the EA via loading a template with new input variables I should be aware of?
 
No.
 
William Roeder:
No.
Is this to the original question... or the alternative question :)
 
ioMatrix:
Is this to the original question... or the alternative question :)

Both

 

Of course you can - simulate right click at exact pixels of chart plus arrows, enter, escape key sequence with user32.dll functions. Without, however, having any option to check if everything went well. And there are no guaranties it will - if terminal is busy it may mix the sequence, Windows may or may not register all of the events as you intended. And you will need to read Microsoft documentation, which may or may not exist for the particular things you need. And if it exist it is such quality that you wish it didn't. 

In short - no.

 
ioMatrix: Is this to the original question... or the alternative question :)

The original question was already answered.

 
ioMatrix:
Alternatively... since the changing of input vars via dialog box triggers a deinit and init call. Is there any difference between that and re-attaching the EA via loading a template with new input variables I should be aware of?

There is a difference.


ioMatrix:
I'm wondering if it is possible to write a script/EA which will make edits to a loaded EA without removing it and reloading it.

The EA is compiled and I do not have access to the source code.

Yes, you can. For example, you can manage expert advisors from the Market in this way.

Expert
Expert
  • www.mql5.com
All other files on this page provide examples/scenarios of library application; they are not needed for the operation of the library. Features Example The library use examples/scenarios are attached to the description. ExpertsRemove.mq5 ExpertsReopen.mq5 ChartsClose.mq5 ExpertLoader_Example.mq5 ExpertsChange_Example.mq5 The above examples...
 
ioMatrix:
Very definitive.

Alternatively... since the changing of input vars via dialog box triggers a deinit and init call. Is there any difference between that and re-attaching the EA via loading a template with new input variables I should be aware of?
The difference is that you will preserve values of static variables on deinit - init sequence via editing inputs.
 
Marcin Madrzak: The difference is that you will preserve values of static variables on deinit - init sequence via editing inputs.
  1. When you apply a template, the EA and all indicators are removed. Then all are reloaded. So you loose any modified global/static variables. Whether that is a problem depends on if the EA is coded to recover. If the power fails, OS crashes, terminal or chart is accidentally closed, on the next tick, any static/global ticket variables will have been lost. You will have an open order but don't know it, so the EA will never try to close it, trail SL, etc. How are you going to recover? Use a OrderSelect loop to recover, or persistent storage (GV+flush or files) of ticket numbers required.

  2. Changing EA inputs or changing the chart Symbol/TF does not reload the EA (only deinit/init cycle.)
Reason: