Need some help creating an array to store the history of an indicator

I want to make an array that will store the ATR value from the past 100 closed candles.

After that I want to run a function that will find the lowest value from the past 100 candles and store that in another variable.

Can anyone help me or provide me a sample snippet of code? I went through the official literature but it just does not want to work for me.