[R-SIG-Finance] determining local min and local max in a time series...

Jeff Ryan jeff.a.ryan at gmail.com
Sat Dec 31 00:35:09 CET 2011


Try findPeaks and findValleys in quantmod. 

HTH
Jeff

Jeffrey Ryan    |    Founder    |    jeffrey.ryan at lemnica.com

www.lemnica.com

On Dec 30, 2011, at 4:51 PM, "Brian G. Peterson" <brian at braverock.com> wrote:

> you can use aggregate and period.apply to get min and max on any
> frequency down to 1 second.
> 
> 
> On Fri, 2011-12-30 at 15:44 -0700, Chris Waggoner wrote:
>> Michael, what timescale are you looking at? If daily low is enough of a
>> minimum for you then you can use
>> 
>> require(quantmod); Lo(my.ohlc.series);
>> http://www.quantmod.com/examples/data/#ohlc
>> 
>> Otherwise, as far as I know you need to use first- and second-order
>> differences. and it is no different with time series than any other 1-D
>> vector.
>> http://tolstoy.newcastle.edu.au/R/help/05/06/6703.html
>> 
>> 
>> On Fri, Dec 30, 2011 at 2:45 PM, Michael <comtech.usa at gmail.com> wrote:
>> 
>>> Happy holidays all!
>>> 
>>> Could anybody please point me to the functions for local min and local max
>>> in a time series?
>>> 
>>> I will be able to write the functions myself in some sort of "for" loop but
>>> I wanted to see if there are good packages/functions existing
>>> already...and  I am interested to know more elegant solution.
>>> 
>>> Thank you!
>>> 
>>>       [[alternative HTML version deleted]]
>>> 
>>> _______________________________________________
>>> R-SIG-Finance at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>>> -- Subscriber-posting only. If you want to post, subscribe first.
>>> -- Also note that this is not the r-help list where general R questions
>>> should go.
>>> 
>> 
>>    [[alternative HTML version deleted]]
>> 
>> _______________________________________________
>> R-SIG-Finance at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions should go.
> 
> -- 
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
> 
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.



More information about the R-SIG-Finance mailing list