Assigning Terminal Variables (images related)
-
After making a simple EA, i added these two blocks at On Init. is it the right way to assign a global variable to your EA ?
was thinking i wouldnt need to be adding a new variables on each tick
it looks like it worked, here is the result of this config on mt5.

I went with the value of the demo account balance because i saw on some videos they did that not sure what you would guys think..
The reasoning behind that is when you want to add more balance into your account the EA will close the live trade unless you change the value of at global variables to the amount of money that you would end up with when you add more balance, meaning you had 1000$ and added 2000$ you should firstly change the global variable to 3000$ then make a depost, with that the EA will not close the live trade and simply continue.
-
You do not need terminal variables unless you are planning to connect to separate MT4 terminals. What you need can be done with standard variables instead.
-
@l-andorrà thanks, i will keep that in mind but can you please expand on that?