I am trying to figure out how to best write code for a rolling average and I cant quite figure it out.
I am trying to create a new variable, "average", which represents the average of the last 250 observations of an existing variable, "price".
So essentially, I need the 251st observation...