[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-finance
Subject:    Re: [R-SIG-Finance] subset section of trading day from RBloomberg bar download
From:       Jeff Ryan <jeff.a.ryan () gmail ! com>
Date:       2013-07-25 21:33:35
Message-ID: CABDUZc85geVQ=FTvfKNFPwT+T8R+HbENsPQcpX5URXv0RKMLRA () mail ! gmail ! com
[Download RAW message or body]

And the xts subset method RMW refers to is:

CC['T07:00/T15:30']

i.e. you need the T

This isn't technically part of the standard at all, but the ability to
filter out parts of a day seemed a reasonable addition.  You can also look
at .indexhour() and .indexmin() and traditional equality ops.

HTH
Jeff


On Thu, Jul 25, 2013 at 2:22 PM, John Laing <john.laing@gmail.com> wrote:

> Tim,
> 
> Rbbg returns bars as a data.frame, so to turn this into an XTS you need to
> split out the time column. Something like this:
> 
> fbx <- xts(ftse_Bars[, c("open", "high", "low", "close", "numEvents",
> "volume")], as.POSIXlt(ftse_Bars$time))
> 
> Then you should be able to use the subset method.
> 
> -John
> 
> 
> On Thu, Jul 25, 2013 at 3:19 PM, Tim Meggs <twmeggs@gmail.com> wrote:
> 
> > Thanks Michael.
> > 
> > I think I was too hasty in posting up my sample code, the as.xts() call
> was
> > not supposed to be included. It was there because I had tried to convert
> to
> > an xts object exactly so I could use the subsetting method you suggested.
> > However, I don't think the conversion works (and hence I can't use that
> > subset method) because the 'time' column returned in the xts object after
> > running as.xts contains character strings and I don't think you can
> sunset
> > easily on these.
> > 
> > I have a feeling I'm being a massive dullard about how to approach this,
> so
> > please anyone feel free to point out the correct way for me to do this.
> > 
> > Thanks,
> > Tim
> > 
> > 
> > 
> > --
> > View this message in context:
> > 
> http://r.789695.n4.nabble.com/subset-section-of-trading-day-from-RBloomberg-bar-download-tp4672338p4672348.html
> 
> > Sent from the Rmetrics mailing list archive at Nabble.com.
> > 
> > _______________________________________________
> > R-SIG-Finance@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@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.
> 



-- 
Jeffrey Ryan
jeffrey.ryan@lemnica.com

www.lemnica.com

	[[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance@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.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic