Can I initialize an array with the maximum values of a variable?

I have an analog signal, this signal is from a scale that is weighing approximately 950 kg, there is a certain margin and sometimes it weighs 951 kg or 949 kg every so often. I can determine that time with the signal and load and unload the tank. 

My question is focused on, is it possible to initialize an array that allows me to store the maximum value of my signal in the interval of loading and unloading and that these values are stored in the array, this in order to add up how many kg have been received. 

 


image.png

image_1.png