Perhaps we're talking about the same: You want to look at the log return of close(-30->30 days ago) and close(-29), then the close(-29d) and close(-28), then close (-28) and close(-27), and so on and so forth until you arrive at log(close(-1)) - log(close(0->today)).
You square them up, divide...