Skip to content
Back to formatted view

Raw Message

Message-ID: <4B56DBE8.8080700@braverock.com>
Date: 2010-01-20T10:33:12Z
From: Brian G. Peterson
Subject: Detecting a range through time for a security?
In-Reply-To: <E7ED988C-ACBF-4CF6-BEB1-8500DD884EEB@me.com>

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