You might wish to have a look at the 'its' package for irregular 
time-series on CRAN.  If your prices are in an its called price, 
then the following will get you on your way.  Since it is not efficient 
either in storage or computation, I offer it because it might be 
convenient for display, further processing, etc.

library(its)
...
tmp <- lagdistIts(diff(log(price)),1,20)
rollvol <- its(as.matrix(sqrt(apply(tmp,1,var,na.rm=TRUE))))

- Giles

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 24 November 2003 15:19
> To: [EMAIL PROTECTED]
> Subject: [R] Bollinger Bands
> 
> 
> Is there a way to create Bollinger Bands without having to loop on the
> observations of a time serie?
> 
> Any help appreciated
> 
> Thanks
> 
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 


********************************************************************** 
This is a commercial communication from Commerzbank AG.\ \ T...{{dropped}}

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to