Get input parameters from another advisor

 
Hi there I would like to load settings from a diferrent advisor running in the same account, how this could be done?
 

You would have to set up some some sort of communication link between the two, or you can write the parameters to a file oninit and have the other EA look for that file and if it exists read the parameters.

You could also use global variables of the terminal.

Global variables of the client terminal are accessible simultaneously from all mql5 programs launched in the client terminal.

https://www.mql5.com/en/docs/globals

Documentation on MQL5: Global Variables of the Terminal
Documentation on MQL5: Global Variables of the Terminal
  • www.mql5.com
Global variables are kept in the client terminal for 4 weeks since the last access, then they will be deleted automatically. An access to a global variable is not only setting of a new value, but reading of the global variable value, as well.
 
Marco vd Heijden:

You would have to set up some some sort of communication link between the two, or you can write the parameters to a file oninit and have the other EA look for that file and if it exists read the parameters.

You could also try to use global variables of the terminal as those can be seen by all applications.

https://www.mql5.com/en/docs/globals

Ok, those global variables would be working on the account but different terminals (PC/VPS)?

 

On the same trading terminal.

I am not sure what you are trying to do but if you want to communicate between trading terminals then you have to set up a network link.

https://www.mql5.com/en/articles/115
A DLL-free solution to communicate between MetaTrader 5 terminals using Named Pipes
A DLL-free solution to communicate between MetaTrader 5 terminals using Named Pipes
  • www.mql5.com
I wondered for some time on possible ways of communication between MetaTrader 5 terminals. My goal was to use tick indicator and display ticks from different quote providers in one of the terminals. The natural solution was to use separate files on a hard drive. One terminal would write data to the file and the other one would read it. This...
 
Marco vd Heijden:

On the same trading terminal.

I am not sure what you are trying to do but if you want to communicate between trading terminals then you have to set up a network link.

https://www.mql5.com/en/articles/115

Huh, this is a bit complex. I want to load RiskFactor parameter from AutoRisk tool on PC from CloseAgent (for closing positions) into the VPS. This is running under the same account but different terminals.

 

You can not exchange information between accounts other then the standard trading functions.

If you mean that you want to change a parameter for an EA that is running on a MQL VPS then you have to change the parameter on your desktop terminal first, and then migrate the new environment to the MQL VPS so that it takes on the new parameter setting.

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...
 
Marco vd Heijden:

You can not exchange information between accounts other then the standard trading functions.

If you mean that you want to change a parameter for an EA that is running on a MQL VPS then you have to change the parameter on your desktop terminal first, and then migrate the new environment to the MQL VPS so that it takes on the new parameter setting.

I was talking about loading input parameters, some kind of info exhange between two advisors running under the same account.

 

Two EA's running under the same account but not on the same terminal. 

If you are building a hybrid system or a semi-automated EA then you need to set up specific remote control functionality (in multiple EA's source,target etc. ) to be able the interface with the different elements of the system.

Reason: