[R-SIG-Finance] xts objects and speed

R. Michael Weylandt <michael.weylandt@gmail.com> michael.weylandt at gmail.com
Tue Jun 19 04:49:29 CEST 2012


If I understand you, it might take a little jerry-rigging (sp?) but I think you could use the to.period() functions and pull out the "High"s and "Low"s. 

Hope this gets you going in the right direction,

Michael

On Jun 18, 2012, at 9:40 PM, E D <e065c8515d206cb0e190 at gmail.com> wrote:

> Hi everyone,
> 
> I'm trying to use R to do some analysis of intraday data.
> Currently I have quotes for one symbol (every 1 min, from 930am to 4pm) and
> about a month and a half of data, and I'm computing things such as the
> trailing 1 hour and 3 hour maximums and minimums for that ticker.
> I'm making use of commands such as max(last(myXTS[1:t],'3 hours')) for
> every t, and I'm finding it rather slow as it takes about 60s to run for
> 12500 observations on a modern workstation.
> 
> Am I making improper or unoptimized use of the xts functions? Could someone
> give me a few points to speed up that kind of calculation? (If the answer
> is "I know this great time series library in C"... that's ok.)
> 
> Thanks in advance.
> 
> ED
> 
>    [[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.



More information about the R-SIG-Finance mailing list