- The array has 5 instances.If bTradeArray is defined as bool bTradeArray[5] then it has 5 instances 0 to 4 not 1 to 5
for (i=1; i<=5; i++) - I want to escape the loop as soon as I get the first false result.
for (i=0; i<5; i++) if (!bTradeArray[i]) break; if (i<5){ // one or more false } else{ // all are true. }
WHRoeder:
- The array has 5 instances.If bTradeArray is defined as bool bTradeArray[5] then it has 5 instances 0 to 4 not 1 to 5
for (i=1; i<=5; i++) - I want to escape the loop as soon as I get the first false result.
Thank you WHRoeder! MUCH obliged!!! You saved me many hours of time!

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am busy writing my first EA and I have certain conditions that I check for false or true. The results are stored in an array.
The array has 5 instances. If only one instance is false it must make the total result also false. To get a true result ALL five instances must be true.
I am not familiar with the "break" operator which I am using in the following code to determine if the final result should be true or false:
for (i=1; i<=5; i++)
if (bTradeArray[i]==true) bTrade = true;
else bTrade = false;
break;
I want to escape the loop as soon as I get the first false result.
Can anyone PLEASE help me?