[R-SIG-Finance] Align 5 minute bars

Jeff Ryan jeff.a.ryan at gmail.com
Thu Jun 16 21:40:39 CEST 2011


Look at align.time. Bars are stamped to the last obs in the period in to.period. 

HTH
Jeff

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

www.lemnica.com

On Jun 16, 2011, at 2:25 PM, Noah Silverman <noahsilverman at ucla.edu> wrote:

> And another question...
> 
> When I use the xts function to.minutes5(), I get a nice OHLC summary, BUT the time stamps are "messy".  Since my first and/or last ticks are not exactly on the minute, every 5 minute bar is now on some mid-minute frequency. 
> 
> Example:
> 
> to.minutes5(ds, indexAt="endof")
>                    ds.Open ds.High ds.Low ds.Close ds.Volume
> 2007-01-01 18:34:44  882.50  883.75 880.50   880.50        83
> 2007-01-01 18:39:46  880.75  881.00 880.00   880.50        18
> 2007-01-01 18:44:52  880.25  880.25 879.50   880.00        25
> 2007-01-01 18:49:03  880.25  881.75 880.25   881.50        83
> 2007-01-01 18:52:11  881.50  881.50 881.50   881.50         9
> 
> 
> 
> Ideally, I'd love to have my bars aligned with round minute numbers.  i.e.
> 18:30
> 18:35
> 18:40
> etc...
> 
> Any suggestions?
> 
> --
> Noah Silverman
> UCLA Department of Statistics
> 8117 Math Sciences Building
> Los Angeles, CA 90095
> 
> _______________________________________________
> 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