eurTOsymbols
is 6 not 7 - as in this line :
eurTOsymbols[7]
For start : index of last element of
is 6 not 7 - as in this line :
So do you mean that I need to go by the index of the last element? because there are a total of 7 numbers if you include the first index of zero correct?
. . .
So this line is your offending line:
for(int i=0; i < eurTOsymbols[7]; i++)
As @Mladen Rakic pointed out, you cannot reference eurTOsymbols[7] because there are only 7 elements total, i.e. 0, 1, 2, 3, 4, 5, and 6.
However, there is additionally something fundamentally wrong with this line. You want i to loop over the array, so you want:for(int i=0; i < 7; i++)
Another way to say it is:
for(int i=0; i < ArraySize(eurTOsymbols); i++)You really should read an MQL introduction book or tutorial page on arrays before posting additional questions on this forum.
So this line is your offending line:
As @Mladen Rakic pointed out, you cannot reference eurTOsymbols[7] because there are only 7 elements total, i.e. 0, 1, 2, 3, 4, 5, and 6.
However, there is additionally something fundamentally wrong with this line. You want i to loop over the array, so you want:Another way to say it is:
You really should read an MQL introduction book or tutorial page on arrays before posting additional questions on this forum.Thank you for providing me with the tutorial page and explaining how to use ArraySize. I was trying to use eurTOsymbols.length for the same purpose earlier but this was not the correct syntax. This has fixed the issue with the error being in the for loop itself. Now however, I get the same error in my if statement. It runs though 7 times then throws the error. Why would it continue to run if it has reached the end of the for loop? Shouldn't it stop? There is something basic I'm missing here and the documentation is not clear to me.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
In my mind I have the for loop and the array set correctly what is causing this array out of range error?
Keep in mind I am brand new to programming and this is my first attempt at a functioning program.