Here is a code to store ticks in array :


Code:
double table[1000];
double average;
double av;
int count;
Code:
if(Close[0]!=table[0]){
      average=0;
      count=0;
      for(i=999;i>=1;i--){
         table[i]=table[i-1];
         if(i==0)table[i]=Close[0];
         average+=table[i];
         if(table[i]!=0)count++;
      }
      if(count!=0)av=average/count;
      table[0]=Close[0];
   }