How to put a variable into constant section
-
I have to create a variable to calculate the initial lot size but I can't see it in the EA input section while using the ea. I think i need to define a constant for it. i don't know how to set a variable value for a constant section
-
It is the same, either create a variable or a constant.
-
@nasserminaei depending of what do you want, you can create a formula there you use 2 constant to make an arimetic operation, then put the result on a variable. Do not forget to reset the variable (if you need it) when it finalize its function
-
Just a such example

-
@jstap
but I can't see it in the 'input' section while using the EA. I want to be able to change the initial lot using the ea. I can't use the optimization feature as the variable is not listed in 'input' section in MT4 -
@Uriel-0
but in this example 'VAR_MA_SL_SHORTS' is not listed in the 'input' section in MT4 when you want to run the EA. I want to optimize the initial lot size and I want it to appear in the 'input' section in MT4. thanks -
@nasserminaei I just write to you an example of how to asign a value to the variable from constants, just to you can see how to use it...
-
@Uriel-0 thanks, let me try to see if i can fix it