[R-SIG-Finance] subset section of trading day from RBloomberg bar download
Tim Meggs
twmeggs at gmail.com
Thu Jul 25 20:40:47 CEST 2013
Hi R finance people,
I have downloaded some 15-min price Bar data across a number of days from
Bloomberg for the March13 FTSE futures.
library(Rbbg)
conn <- blpConnect()
ftse <- "Z H3 Index"
ftse_Bars <- bar(conn, ftse, "TRADE", "2013-01-04 07:00:00.000", "2013-02-01
20:00:00.000", "15")
ftse_Bars<-as.xts(ftse_Bars)
blpDisconnect(conn)
The data looks like this:
time open high low close
numEvents volume
2013-01-10T01:00:00.000 2013-01-10T01:00:00.000 6050.5 6050.5 6047.0 6048.0
12 12
2013-01-10T01:15:00.000 2013-01-10T01:15:00.000 6046.5 6047.5 6046.5 6047.5
2 2
2013-01-10T01:30:00.000 2013-01-10T01:30:00.000 6046.5 6046.5 6044.5 6045.0
12 21
2013-01-10T01:45:00.000 2013-01-10T01:45:00.000 6044.5 6045.5 6044.5 6045.5
6 9
2013-01-10T02:00:00.000 2013-01-10T02:00:00.000 6045.5 6049.0 6045.5 6047.5
11 13
2013-01-10T02:15:00.000 2013-01-10T02:15:00.000 6053.0 6059.0 6049.0 6058.0
37 68
I would like to remove those bars that fall outside the hours 07:00 UTC to
15:30 UTC, to leave me with data just from the hours when the cash index is
open. Given the time column I receive from Bloomberg is in the slightly odd
format format "%Y-%m-%dT%H:%M:%S" with the strange "T" in the middle how can
subset out my desired data?
Any help greatly appreciated.
Thanks
Tim
--
View this message in context: http://r.789695.n4.nabble.com/subset-section-of-trading-day-from-RBloomberg-bar-download-tp4672338.html
Sent from the Rmetrics mailing list archive at Nabble.com.
More information about the R-SIG-Finance
mailing list