Can't get array to print data

 

In this EA, I am simply trying to add up the number of times a given distance occurs between median price and a simple MA.  When the array prints in the de-int, it prints all 0's.  I think there must be something wrong with the way I am adressing or assigning the arrays?

extern int LookBack=26;
double Price,MA,Diff,HighDiff=0,OldDiff=0;
double AtRay[2][1000];
 
 
 
int start()
{
 
Price =((Ask-Bid)/2)+Bid;
MA=iMA(NULL, PERIOD_M1, LookBack, 0, MODE_SMA, PRICE_MEDIAN, 0);
Diff=MathAbs(Price-MA);
 
//only if Diff HAS changed since last tick
//and Diff >0
if(Diff!=OldDiff && Diff >0)
{
   OldDiff=Diff;
   //Determine biggest Diff for use in later for loop
   if(Diff>HighDiff)
   {
      HighDiff=Diff;
   }
   //need to convert pips to integer
   //tried to use Digits here but it returned 2, not 4
   Diff*=10000;
   int intDiff=Diff;
   //Print("intDiff:",intDiff);
   //assign data to array
   AtRay[0,intDiff]=Diff;
   AtRay[1,intDiff]+=1;
}
 
return(0);
}
 
 
 
 
int deinit()
{
 
//again must change double to int for loop
HighDiff*=10000;
int PrintDiff=HighDiff;
//Print("PrintDiff:",PrintDiff,"   Digits:",Digits);
for(int i=0;i<=PrintDiff;i++)
{
   Print(AtRay[0,i],"  ",AtRay[1,i]);
}
   
return(0);
}
 

Price =((Ask-Bid)/2)+Bid;

Maybe try this..

Price = NormalizeDouble(((Ask-Bid)/2)+Bid,Digits);

Reason: