How to reset conditon?

 
Ok so Im relatively new to making "checkpoints" as in first condition is met and THEN the next one is met and this is what I have so far
 //--- main loop
   for(int i = limit-1; i >= 0; i--)
     {
      if (i >= MathMin(5000-1, rates_total-1-50)) continue; //omit some old rates to prevent "Array out of range" or slow calculation   
      
      //Indicator Buffer 1
      if(iStochastic(NULL, PERIOD_CURRENT, 5, 10, 2, MODE_LWMA, 0, MODE_SIGNAL, i) > 7 //Stochastic Oscillator > fixed value
      && iStochastic(NULL, PERIOD_CURRENT, 5, 43, 3, MODE_LWMA, 0, MODE_MAIN, i) == 3 //Stochastic Oscillator is equal to fixed value
      )
      continue;
      if(iStochastic(NULL, PERIOD_CURRENT, 5, 10, 2, MODE_LWMA, 0, MODE_MAIN, i) > 5
      && iStochastic(NULL, PERIOD_CURRENT, 5, 43, 3, MODE_LWMA, 0, MODE_MAIN, i+1) < 5 //Stochastic Oscillator crosses above fixed value
      )
        {
         Buffer1[i] = Low[i]; //Set indicator value at Candlestick Low
        }
      else
        {
         Buffer1[i] = EMPTY_VALUE;
        }
     }
   return(rates_total);
  }

So as you can see I am using continue but for some reason multiple arrows pop up. Im trying to only get one arrow to pop up and then have the entire thing reset so it starts from the top again. Has anyone done this before? Id love to see how. Maybe I modify the loop to only run once? I dont know
 
      if(iStochastic(NULL, PERIOD_CURRENT, 5, 10, 2, MODE_LWMA, 0, MODE_SIGNAL, i) > 7 //Stochastic Oscillator > fixed value
      && iStochastic(NULL, PERIOD_CURRENT, 5, 43, 3, MODE_LWMA, 0, MODE_MAIN, i) == 3 //Stochastic Oscillator is equal to fixed value
      )

You will find it extremely rare (if ever) for the stochastic to exactly equal 3 so don't expect the continue to be executed.

      if(iStochastic(NULL, PERIOD_CURRENT, 5, 10, 2, MODE_LWMA, 0, MODE_MAIN, i) > 5
      && iStochastic(NULL, PERIOD_CURRENT, 5, 43, 3, MODE_LWMA, 0, MODE_MAIN, i+1) < 5 //Stochastic Oscillator crosses above fixed value
      )

You are looking for a cross of 2 stochastics with different settings ???

 
Keith Watford:

You will find it extremely rare (if ever) for the stochastic to exactly equal 3 so don't expect the continue to be executed.

You are looking for a cross of 2 stochastics with different settings ???

Hi keith, I forgot to include, please ignore my indicator settings because I changed them to preserve my strategy. Thank you for understanding.
Reason: