Can somebody PLEASE help me with this problem? - page 2

 
ernest02:

I call it a loop since it has to "loop" four (4) times through the code in brackets after the if statement while the condition is true.

I am not sure why you changed the Close[i] and Open[i] functions to Close[0] and Open[0]. Please explain if you don't mind.

Your code
while(nBarHighNo != 5 || nBarLowNo != 5)
         break;
            {           
...
for (i = 4; i >= 1; i--)
              RefreshRates();
                  if (Close[i] < Open[i])

There is no open bracket after the while or for loop. there is only one statement after: break/refresh. The statements after are not part of the loop.

earnest showed

for (i = 4; i >= 1; i--)
                 { 
                  RefreshRates();
                  if (Close[i] < Open[i] && BarTime != Time[i])