I have an Array which contains names of variables. Is there a way to use the Array entries to assign a value instead of having to do...
if (Per_Array[i,0]) = "Ind0_DonchianPeriodsEntry"
if (Per_Array[i,0]) = "Ind0_DonchianPeriodsExit"
Any help would be appreciated
There is, to my knowledge, no eval() functionality in MQL4/MQL5.
For your specific task, perhaps a hash would work for you.
Thank you for sharing your idea. Apologies,I really should have mentioned that I'm using MQL4 - Your suggestion looks to be MQL5 maybe.
It should work in either platform, however, using mutable strings to specify state is a dangerous practice. I can't help but to think there is likely a better, simpler, and safer way to accomplish what you are ultimately trying to achieve.