Script structure

 
int start()
  {
  int A;
    while(true)
    {
     A++;
     Comment(A);
      Sleep(10);
      RefreshRates();
      if(Close[1]-Open[1]>0)
      {
        Alert("Bullish bar");
        break;
      }
    }
   return(0);
  }

Sleep(10) is to ease pressure on processor.

while(true) is to make the script search until the condition is met.

Is there way to modify the script to make it better for platform and computer processor and

make the script like work better?

Thank You.

 

Make it an indicator.

 

Your code can crash your terminal

int newtime;
int start()
  {
  if(newtime==Time[0])return(0);
  newtime=Time[0]; 
  if(Close[1]-Open[1]>0)Alert("Bullish bar");
  return(0);
  }
Reason: