Skip to content
Prev 5762 / 15274 Next

Subject: Re: Standard Deviations using Sliding window?

I think Josh's earlier suggestion of runSD is more along the lines of 
what you want.

While you can certainly do what you want via rollapply, your original 
example will work via

getSymbols('AAPL')
AAPL$STDDEV = runSD(Cl(AAPL), 20)
AAPL$SMA = SMA(Cl(AAPL), 10)

Regards,

    - Brian
Robert Nicholson wrote: