Should we be using shift with rolling here to get a proper rolling average?

This comes up later in the predicting the stock market guided project. Is it applicable here?