how to change the values of the input variables and apply it on program

 

I am just a newbie in programming mt4. Can somebody help me in changing the values of input variables... I've tried changing the values in the input tab inside the properties window(F7) before running the program but when I start to execute it, the value returns to the default value. I also tried executing other EA with input parameters but still, even I change the values before running the program, same thing happened. *sigh*

Hope to get a reply soon... Thanks!

 
eybi:

I am just a newbie in programming mt4. Can somebody help me in changing the values of input variables... I've tried changing the values in the input tab inside the properties window(F7) before running the program but when I start to execute it, the value returns to the default value. I also tried executing other EA with input parameters but still, even I change the values before running the program, same thing happened. *sigh*

Hope to get a reply soon... Thanks!

It's a bit weird. There must be a place where those data are initialized with default value. Look in the init() or just search your program to find where they are initialized.

Did you try to change those parameters when your ea is already running: lauch it and then open the properties panel to change them and see if new values are taken into consideration or not.

If you can't find your way, just show your code (SRC button) and tell wich data is concerned, someone will certainly help you more efficiently.

 
eybi:

I am just a newbie in programming mt4. Can somebody help me in changing the values of input variables... I've tried changing the values in the input tab inside the properties window(F7) before running the program but when I start to execute it, the value returns to the default value. I also tried executing other EA with input parameters but still, even I change the values before running the program, same thing happened. *sigh*

Hope to get a reply soon... Thanks!

Have you ever opened the sourcecode in MetaEditor?

 
Jacques366:

It's a bit weird. There must be a place where those data are initialized with default value. Look in the init() or just search your program to find where they are initialized.

Did you try to change those parameters when your ea is already running: lauch it and then open the properties panel to change them and see if new values are taken into consideration or not.

If you can't find your way, just show your code (SRC button) and tell wich data is concerned, someone will certainly help you more efficiently.

Yes there is a line of code that is created automatically but I want it be changeable by the trader not through code. I mean, when the trader goes to the properties(F7) then Input tab where the parameters were displayed with their default values(which is been set upon creation of the EA), they can edit the values and change it before they start the execution. What was happening to me is that even I change the values of the parameters on the properties window, still, when I start the execution the values return to the default values. :c

 
robofx.org:

Have you ever opened the sourcecode in MetaEditor?

yes sir. I coded the program.

 
eybi:

yes sir. I coded the program.

You can probably post part of your code so we can help you.

 
robofx.org:

You can probably post part of your code so we can help you.


This is the properties window where I want to change the values of the parameter Lots so I will change the values like this:



I changed the value to 0.1 and there is no problem regarding minimum lots because I posted it on my comment:


The Problem is when I Start the execution, The value of parameter Lots returns to 1.0


I've read about the function UninitializeReason() but I don't know how to use it yet. It only returns me a value of 5 which means the parameters were changed but still I cant change the values of my "Lots".

Reason: