Detecting a range through time for a security?
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