> Here was a naive attempt to do standard deviation with sliding window
>>require(quantmod)
>>getSymbols("AAPL")
>> AAPL$STDDEV = sd(Cl(AAPL), 20)
>> AAPL$SMA = SMA(Cl(AAPL), 10)
>> AAPL

I am pretty sure that rollapply in the ZOO library would work for you. 



      
	[[alternative HTML version deleted]]

