I need help with my function please

 



double Recent_TD_Point[];
for
(int i=0;i<3000;i++)   {if(High_TD_Point_Value(i)>0){         Recent_TD_Point[i]=High_TD_Point_Value(i);         Print(Recent_TD_Point[i]);         }   } //------------------------------------------------------------------------------ double High_TD_Point_Value(int CandleRef){          if(High[CandleRef]>High[CandleRef-1]&& High[CandleRef]>High[CandleRef+1])            {             return (High[CandleRef]);            }          else            {             return (0);            }       }
I have created the below function that would look for the value of peak points and trying to store its value in an array but for some reason, it did not work

can anyone help me?
 

Of course, it doesn't work.

  1. You can't store values into an array that has no size.
  2. When i is zero, you try to read High[0-1]
 
William Roeder:

Of course, it doesn't work.

  1. You can't store values into an array that has no size.
  2. When i is zero, you try to read High[0-1]

is not the non-specified size of  one-dimension initialized array , defined by a compiler based on the initialized sequence?

would help me by sending me where exactly in the documentation I should set the size of an array?

 
Michael:
I have created the below function that would look for the value of peak points and trying to store its value in an array but for some reason, it did not work

can anyone help me?
int s = ArraySize(Recent_TD_Point);
        ArrayResize(Recent_TD_Point,s+1);
        Recent_TD_Point[s]=High_TD_Point_Value(i);
Reason: