You can't proceed this way. You have to assign value to your array one by one.
Your array is bool, your input parameters are int, not a good idea.
A workaround could be to use a string as input variable, say
extern string Hours = "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23";
and then use StringSplit to get an array of strings from this single string, and call StrToInteger for every element to build array of ints.
You can't proceed this way. You have to assign value to your array one by one.
Your array is bool, your input parameters are int, not a good idea.
thanks i got it to work one-by-one, and thanks for the tip re book/ints.
Is there a technical reason why you cant add them in one, or just something peculiar to mql4?
thanks i got it to work one-by-one, and thanks for the tip re book/ints.
Is there a technical reason why you cant add them in one, or just something peculiar to mql4?
Can you explain how it is done??? i have the same problem

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I'm sure this is a basic programming misunderstanding on my behalf -
I'm getting a 'constant expression required' error message when compiling.
I simply want to create an array based on extern inputs to the program. I've tried putting the code globally and in a function but getting the same results. It seems to work if I simply assign the array values manually, but not when I try to use a variable.
What I was trying to do was create a bool function to say yes or no to trading at a particular time, based on the inputs. I understand there are probably easier ways, but I want the 'on/off' per hour ability.
Any help appreciated. Thanks, Mark.