MQL5 copy and store the high of previous 5 bars

 

I want to copy and save the highest value  of the last 5 bars.I want to use this value in later calculations, so I don't want  the value to recalculate as bars change.

How do I do that?

 

In init() function  , array[] should be initialised by highest value of the last 5 bars

int start_pos =1;
int count = 5;
double array[];
int init(){
   ArraySetAsSeries(r,true);
   CopyHigh(_Symbol,_Period,start_pos,count,array);
   return(0);
}
Reason: