[R] Bollinger Bands

Heywood, Giles Giles.Heywood at CommerzbankIB.com
Tue Nov 25 08:58:00 CET 2003


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: Arnaud_Amsellem at ssga.com [mailto:Arnaud_Amsellem at ssga.com]
> Sent: 24 November 2003 15:19
> To: r-help at stat.math.ethz.ch
> 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
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 


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




More information about the R-help mailing list