Help with For Loop

 

Hello, Im using a for loop to determine how many times price has come near a certain level. I am getting an error on the first line, saying "<= asignment expected"


any idea? I have already defined the Piv variable in the beginning of the EA. thanks


Piv=(iHigh(NULL,1440,1)+iLow(NULL,1440,1)+iClose(NULL,1440,1))/3;
   int Max = Bars;
   for(int i;i<=Max;i++){//for bracket
   double BarClose = iClose(NULL,0,i);
   double BarHigh = iHigh(NULL,0,i);
   double BarLow = iLow(NULL,0,i);
   int HitCount;
   
   if((BarClose - Piv <= 7) || (Piv - BarClose <= 7) || (BarHigh - Piv <= 7) || (Piv - BarHigh <= 7) || (BarClose - Piv <= 7) || (Piv - BarClose <= 7)) HitCount += 1;
   }//for bracket end
 

for(int i;i<=Max;i++){//for bracket

You have to do more than declare it; you need to set it to a value. probably

for(int i=0;i<=Max;i++){//for bracket

 
solved, thanks!