Maths : Keeping total of last 30 days and previous 30

rather than shifting all values by 1 array element each time a new one is available, why not use an index to keep track of where the next value is to be written, which also means it over-writes the oldest value.

if you want display value from newest to oldest, start at index-1 (accounting for wraparound and decrement (accounting for wraparound) until the index value is reached

you can also have a size variable to keep track of the # of values in the buffer