Dynamic Varaible
-
I need variables in my blocks that I can't define while creating the EA. Basically my variables are dynamic.
e.g.
I have an EA for which the user will provide a list of all currency pairs that he wants to trade. I would like to create a double type variable for each of these values provided by the user. My EA will then assign value to these variables through blocks and use it when required. -
I figured this can be very easily done using custom code. I have come so far. Can you please help me with the right syntax for this? What do I write in this code instead of $Market for this to work? I basically need the variable name to be passed by the previous block

-
What about this Variables thing above the list of blocks?
Otherwise if you are thinking about PHP-like variables, those are not possible. MQL4/5 is based on C++ (I believe), in which all variables are defined before the compilation. But you can probably work with arrays. There are some dynamic arrays. But it's a pain in the ass to work with arrays in MQL4/5, at least for me. You can try it. To define Variable that is array, try to name that variable with []