[R-SIG-Finance] Detecting a range through time for a security?
Brian G. Peterson
brian at braverock.com
Wed Jan 20 11:33:12 CET 2010
donahchoo at me.com wrote:
> Hello,
>
> I'd like to run a study that detects a range for a security and
> determines how long the security stays within this range.
>
> Is there a package that will do this already?
>
> If not, does anyone have suggestions on how to implement this?
require(zoo)
rollapply(pricedatadata,width,FUN=range)
'detection' should be trivial once you know the ranges.
Also, see the copious documentation for package 'TTR'
Regards,
- Brian
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock
More information about the R-SIG-Finance
mailing list