Communicating with an Expert Advisor

 
I've written a couple of bots for MT4 as Expert Advisors. I typically run them on my desktop. I'd like to be able to change some of their external variables while they are running. Is there some easy way to do that? Can they have any kind of user interface?
 
David Schwartz:
I've written a couple of bots for MT4 as Expert Advisors. I typically run them on my desktop. I'd like to be able to change some of their external variables while they are running. Is there some easy way to do that? Can they have any kind of user interface?


Yes you can press F7 in the terminal.

For on screen solution you can use:

OBJ_EDIT


But you will have to copy the initial value of the input parameter because as a fixed value it can not be overwritten so you copy it to another variable which then can be edited.

https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_edit

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_EDIT
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_EDIT
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types / OBJ_EDIT - Reference on algorithmic/automated trading language for MetaTrader 5
 
Marco vd Heijden:


Yes you can press F7 in the terminal.

For on screen solution you can use:


But you will have to copy the initial value of the input parameter because as a fixed value it can not be overwritten so you copy it to another variable which then can be edited.

https://www.mql5.com/en/docs/constants/objectconstants/enum_object/obj_edit


Thanks. That's not as nice as an advisor being able to have some kind of UI, but it will get the job done.

 
David Schwartz:


Thanks. That's not as nice as an advisor being able to have some kind of UI, but it will get the job done.

You can certainly code your own designed GUI.

It all depends on how much time you want to invest in your project.

 
David Schwartz:
I've written a couple of bots for MT4 as Expert Advisors. I typically run them on my desktop. I'd like to be able to change some of their external variables while they are running. Is there some easy way to do that? Can they have any kind of user interface?
Change some External variables, How many times do you do that in a day? How do you choose the settings?
Reason: