Download MetaTrader 5
To add comments, please log in or register
Sell products right in MetaTrader. Millions of traders are waiting for this!
macpee
287
macpee 2016.10.04 23:21 
Hi comrades. How can I tell EA that the value of an input has changed in the parameter window for the EA. The input can be of type integer or double or string (or extern or input) etc. I want my EA to know that the value of an input parameter has changed the moment I clicks OK button. Thank you in advance.
Keith Watford
Moderator
7982
Keith Watford 2016.10.05 00:12  
macpee:
Hi comrades. How can I tell EA that the value of an input has changed in the parameter window for the EA. The input can be of type integer or double or string (or extern or input) etc. I want my EA to know that the value of an input parameter has changed the moment I clicks OK button. Thank you in advance.
When you change inputs and click OK, the EA is re-initialized and the EA automatically uses the new parameters.
macpee
287
macpee 2016.10.05 06:00  
GumRai:
When you change inputs and click OK, the EA is re-initialized and the EA automatically uses the new parameters.

Thank you, I know of that. But I want to do something else when an input is CHANGED. I need something like a change event for parameter window, similar to the CHARTEVENT_OBJECT_CHANGE for graphical object property changed via the properties dialog.

What I want to do is assign the new value to a Global Variable so that when I view another chart where that EA is attached, I wont have to re-enter the new value of the input parameter again. I want the change of parameter to take effect on all the charts where the EA has been attached. Thank you in advance





peter.MT4Web
158
peter.MT4Web 2016.10.05 06:23  

You get the info that parameters have changed in OnDeinit and you can react in the following OnInit.

macpee
287
macpee 2016.10.05 06:36  
eddie:

You get the info that parameters have changed in OnDeinit and you can react in the following OnInit.


Thank you. But change of parameter input is not the only event that triggers OnDeinit or OnInit, other events do trigger them too. I want something that only the Change inparameter input triggers.

What I want to do is assign the new value to a Global Variable so that when I view another chart where that EA is attached, I wont have to re-enter the new value of the input parameter again. I want the change of parameter to take effect on all the charts where the EA has been attached. Thank you in advance

honest_knave
969
honest_knave 2016.10.05 07:57  
macpee:

Thank you. But change of parameter input is not the only event thattriggers OnDeinit or OnInit, other events do trigger them too. I wantsomething that only the Change inparameter input triggers.

What I want to do is assign the new value to a Global Variable sothat when I view another chart where that EA is attached, I wont have tore-enter the new value of the input parameter again. I want the changeof parameter to take effect on all the charts where the EA has beenattached. Thank you in advance


Sounds like you have found your own solution: create / update global variables (you'll need to choose a method to do so: manually, OBJ_EDIT etc). Then run a short timer in your code that checks the value of the global variable. As soon as there is a change, all instances of your EA will update accordingly.
peter.MT4Web
158
peter.MT4Web 2016.10.05 10:54  

Why not trying to read the manual about the parameter comming with OnDeinit ?

/
To add comments, please log in or register