problem about assign parameter into array[MT5] help~

 
double Buy()
{
 double Dist[];
 ArraySetAsSeries(Dist,true);
 ArrayResize(Dist,5,0);
 
double Buy[5]={1,2,3,4,5};

  for(int i=0;i>=5;i++)
  {
   Dist[i]=Buy[i]; //P.S i tried ArrayCopy,ArrayInsert, those can't work
  }
 double Test=321;
 return (Test);
}

debug mode

why i cannot assign Buy[i] into Dist[i]? I tested it in debug mode,when program run into for loop, it jumps to Test=321 directly and parameter in Dist[5] are 0.

I also tried ArrayCopy,ArrayInsert,those cannot work.

can anyone help me to solve this problem? 

Thank you very much.

 
Wai Shing Ng: why i cannot assign Buy[i] into Dist[i]? I tested it in debug mode,when program run into for loop, it jumps to Test=321 directly and parameter in Dist[5] are 0. I also tried ArrayCopy,ArrayInsert,those cannot work. can anyone help me to solve this problem? Thank you very much.
double Buy()
{
 double Dist[];
 ArraySetAsSeries(Dist,true);
 ArrayResize(Dist,5,0);
 
double Buy[5]={1,2,3,4,5};

  for(int i=0;i<5;i++)
  {
   Dist[i]=Buy[i]; //P.S i tried ArrayCopy,ArrayInsert, those can't work
  }
 double Test=321;
 return (Test);
}
 
Fernando Carreiro #:

thank you very much

 
Wai Shing Ng #: thank you very much
You are welcome!