Skip to content
Back to formatted view

Raw Message

Message-ID: <67F47F37-02C9-4C0A-A7DB-EA9928E241F4@gmail.com>
Date: 2011-06-16T19:40:39Z
From: Jeff Ryan
Subject: Align 5 minute bars
In-Reply-To: <A93F93DC-C6B4-4A8C-A830-65B654DD41BD@ucla.edu>

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.