[R-SIG-Finance] 1 minute time interval in Bloomberg

John Laing john.laing at gmail.com
Mon May 14 19:17:38 CEST 2012


Krisan,

I'm not aware of a way to get time periods back that have no data
associated. But this makes sense: what would you expect Bloomberg to
show you for OHLC in minutes when there were no trades?

You could get the set of all dates and diff it with the dates you
actually got back:
all.mins <- seq(as.POSIXct("2012-03-21 09:00:00"),
as.POSIXct("2012-03-21 15:00:00"), "1 min")
data.mins <- as.POSIXct(t_bar1$time, format = "%Y-%m-%dT%H:%M:%S")
missing.mins <- as.POSIXct(setdiff(all.mins, data.mins), origin =
as.Date("1970-01-01"))

What you do from there is up to you.

John


On Mon, May 14, 2012 at 5:12 AM, krisan haria <krisanharia at gmail.com> wrote:
> Hi
>
> I am trying to get data (open,high,low close) in 1 minute time intervals
> from Bloomberg.
>
> Currently I have the following
>
> library(RBloomberg)
> conn=blpConnect()
> t_bar1= bar(conn, "IUSA IM Equity", "TRADE", "2012-03-21 09:00:00.000",
> "2012-03-21 15:00:00.000", "1")
>
> head(t_ob1)
>                                           time    open    high     low
> close numEvents volume
> 2012-03-21T09:01:00.000 2012-03-21T09:01:00.000 10.5825 10.5875 10.5825
> 10.5875         2    295
> 2012-03-21T09:05:00.000 2012-03-21T09:05:00.000 10.5850 10.5850 10.5850
> 10.5850         1   3000
> 2012-03-21T09:07:00.000 2012-03-21T09:07:00.000 10.5850 10.5850 10.5850
> 10.5850         1   1352
> 2012-03-21T09:11:00.000 2012-03-21T09:11:00.000 10.5875 10.5875 10.5875
> 10.5875         1   3465
> 2012-03-21T09:18:00.000 2012-03-21T09:18:00.000 10.5850 10.5850 10.5850
> 10.5850         1   1314
> 2012-03-21T09:23:00.000 2012-03-21T09:23:00.000 10.5800 10.5800 10.5800
> 10.5800         1    400
>
>
> As you can see, it only seems to get the data for when there was a trade.
> How do I get this data for the whole day inlcuding the 1 minute intervals
> when there were no trades
>
>        [[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