Enabling Remotely Expert Advisor

 

Hello,

The situation is, I am running MetaTrader on Linux machine through Wine, I want to develop my software which will do some things. I do have some questions about Meta Trader, I would like to know from developers side is this possible to do such things:

1) Enable / Disable Expert Advisor remotely from 3rd party software (my own) - so far I find one solution here, in expert advisor to make regular calls to some PHP website and scan for the flags enable / disable. This could work good for me, but are there more solutions for this, for example may be updating some ini file or calling somehow metatrader some DLL functions (exporting DLL) during runtime?

2) Is it possible during runtime in MetaTrader to update ExpertAdvisor code for current active Expert Advisor (from 3rd party software without visual control)?

2a) if not possible to update code, may be it is possible to create new ExpertAdvisor and to link to Currency pairs (from 3rd party software without visual control)?


Thanks!

 
  1. Of course it's possible. EA could poll, or receive signals, or other software could write a file for the EA to read, or other software you post a message disabling all EAs.
  2. Of course it's possible. Shutdown the terminal, install the new code, restart the terminal
  3. Make the EA dumb, it justs receives control from #1 and does it. No update needed.
 

Hello WHRoeder,

1) It is clear for me.

2) You mean, my software should be into two parts: server and client, client app would sit on the same computer as terminal.exe and server would be on remote PC. From server app I should be able to send a request to client: "takes this new Expert Advisor code, shutdown the terminal.exe, install new code, start the terminal.exe again" - everything automatically by client.exe but controlled from server.exe, yes?

3) The third option is to create special EA (which talks through web may be) which is able to update expert advisor file during runtime ?

What I need to achieve the final goal is to create application from which user (from personal computer anywhere) can upload / update the expert advisor code to server where terminal.exe is running. I mean remote control of Expert Advisors management without even seeing meta trader itself. Everything should be managed from created new software.


Thanks!

 
cedas:

Hello,

...2) Is it possible during runtime in MetaTrader to update ExpertAdvisor code for current active Expert Advisor (from 3rd party software without visual control)?...

You can hot-swap the underlying code file even using its own code, without affecting its run. The ex4 file is not locked and is already fetched by the terminal. But there are 2 weak points - you need to use WinAPI file functions, as the code file is outside the sandbox, and you need to force the EA to reload after the update. The first one is ok, the second one I never tried (but it is possible) - you may get inspiration from the SciTe editor's "RefreshCrapT4.exe".
 

Thanks for the comments.

Are here any developers that could provide me a good / effective / stable solution - and how much it could cost?

Also, I have another question is it possible to run terminal.exe from console and to assign username / password, for example "terminal.exe server username password " or "terminal.exe config\config.ini" ? This way can call different login on the demand.

Reason: