EMA counter problem

 
Hi guys, I want to write a simple loop that counts how many times some part of a candle (be it Low or High) touches the 200-p EMA.
Unfortunately whenever I start the program, it automatically exits without doing anything. 

Any suggestions? 
Thank you!

double EMA[];


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

int init(){



return(0);}
int start()
  {
  int i,emaCount;
      
      
   
   for(i=Bars;i>=0;i--)
     {
      emaCalc(i,emaCount);
      if(i==0)Alert("EMA: ",emaCount);
      
     }

   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void emaCalc(int i,int emaCount)
  {
   
   EMA[i]=iMA(NULL,0,200,0,MODE_EMA,PRICE_CLOSE,i);
   if((High[i]==EMA[i]) || (Low[i]==EMA[i]) || ((High[i]-EMA[i])>=-0.2) || ((High[i]-EMA[i])<=0.2) || ((Low[i]-EMA[i])>=-0.2) || ((Low[i]-EMA[i])<=0.2))
   emaCount+=1;
   }
 
int start()
  {
  int i,emaCount;
      
      
   ArrayResize(EMA,Bars);
   for(i=Bars-1;i>=0;i--)
     {
      emaCalc(i,emaCount);
      if(i==0)Alert("EMA: ",emaCount);
      
     }

   return(0);
  }
 

emaCount should be declared Globally or passed to the function by reference. It is always a good idea to set it to zero before any calculations

High[i]-EMA[i])>=-0.2) || ((High[i]-EMA[i])<=0.2

 You will find that ANY number you can think of will ALWAYS be 

either >=-0.2

or      <=0.2

 
Thank you Keith for your help, anyway I still get 0 as Alert. (Ema: 0).
Reason: