[R-SIG-Finance] Rbloomberg problem

davidr at rhotrading.com davidr at rhotrading.com
Thu May 8 20:40:55 CEST 2008


I installed the new RBloomberg from r-forge into a new R 2.7.0 patched, and I am getting the same results as Jorge.

> sessionInfo()
R version 2.7.0 Patched (2008-05-06 r45624) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RBloomberg_0.1-11  chron_2.3-22       zoo_1.4-2          RDCOMClient_0.92-0

loaded via a namespace (and not attached):
[1] grid_2.7.0     lattice_0.17-7 tools_2.7.0   

> ls(all=TRUE)
character(0)
> library(RBloomberg)
> conn <- blpConnect()
> ex1 <- blpGetData(conn, "ED1 Comdty", c("BID","ASK"), start=as.chron(Sys.time() - 3600), barfields="OPEN", barsize=2)
> ex2 <- blpGetData(conn, "ED1 Comdty", c("BID"), start=as.chron(Sys.time() - 3600), end=as.chron(Sys.time() - 3420), barsize=0)
> ex1
                    BID.OPEN ASK.OPEN
(05/08/08 13:14:41)       NA       NA
> ex2
Error in substr(text, first, last) : invalid substring argument(s)

(I was also got the same results in R 2.6.1 patched with the RBloomberg_0.1-10,
and R 2.7.0 with RBloomberg_0.1-10)
(Is it possible that Bloomberg is confused? Does BDP work in Excel? BDH?)

----------------------------
David L. Reiner, PhD
Head Quant
Rho Trading Securities, LLC
----------------------------

From: r-sig-finance-bounces at stat.math.ethz.ch [mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Ana Nelson
Sent: Thursday, May 08, 2008 11:09 AM
To: r-sig-finance at stat.math.ethz.ch
Subject: Re: [R-SIG-Finance] Rbloomberg problem

I'm using R 2.7

There is a newer version of RBloomberg which you can try, 0.1-11. It's not on CRAN yet, but you can get it from r-forge:
http://r-forge.r-project.org/projects/rbloomberg/

To install the package directly within R type: install.packages("RBloomberg",repos="http://R-Forge.R-project.org")

I have attached a script of what I am running. Will you run this and send me your console transcript as a text file attachment? (you can send it directly to me, not the list)


2008/5/8 Jorge Nieves <jorge.nieves at moorecap.com>:
 Thank you...

I just re-run them now and obtained the same results.. What version of R
are you using?

-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch
[mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Ana Nelson
Sent: Thursday, May 08, 2008 11:40 AM
To: r-sig-finance at stat.math.ethz.ch
Subject: Re: [R-SIG-Finance] Rbloomberg problem

Hi, Jorge,

Was the market actually open for the time period you requested? I've
just run those queries and they are working fine for me.

Will you try this again making sure the market you are querying is open
and let me know if it works for you?

Regards,
Ana



2008/5/8 Jorge Nieves <jorge.nieves at moorecap.com>:

> Hi,
>
> I am new R user and have been trying to properly configure an R
> working environment.  I  have it up and ruining except for the
Rbloomberg.
>
> I tried running the examples in the documentation. And encountered
> into several issues:  First, R2.5.1 was crashing and I could never
> understand why. I installed the latest release R 2.7.0 and was
> eventually able to run only tow of the examples from
> blpGetData(RBloomberg)
>
> The intraday "Intraday bars" and the "Tick-by-tick" examples do not
run.
> I am wondering if (1) made a mistake in the set up? Or (2) there is a
> problem here with R 2.7.0 too.
>
> Currently using
> Package:       RBloomberg
> Version:       0.1-10
> Date:          2006-05-04
> Built:         R 2.5.1; ; 2007-07-22 18:19:52; windows
>
> Usinga lso 'RDCOMClient' version 0.92-0
>
> Any recommendatiosn?
>
> blpGetData(RBloomberg) examples.
>
> library(RBloomberg)
>
> .bbfields <- blpReadFields("C:/Program Files/blp/API")
>
> ## Not run:
> conn <- blpConnect()
>
> ## Snapshot
> eda <- blpGetData(conn, c("ED5 Comdty","ED6 Comdty","ED7 Comdty",
> "ED8 Comdty"), "BID")
> eda
>
> ## Historical (last 30 days)
> edb <- blpGetData(conn, "ED1 Comdty", "PX_LAST",
> start=as.chron(Sys.time() - 86400 * 30)) edb
>
> ## Intraday bars (last hour in 2 min bars) edc <- blpGetData(conn,
> "ED1 Comdty", c("BID","ASK"),
> start=as.chron(Sys.time() - 3600), barfields="OPEN", barsize=2) edc
>
> ## Tick-by-tick (3 minutes starting an hour ago) edd <-
> blpGetData(conn, "ED1 Comdty", c("BID"),
> start=as.chron(Sys.time() - 3600),
> end=as.chron(Sys.time() - 3420), barsize=0) edd
>
> blpDisconnect(conn)
> ## End(Not run)
>
>
> Output
>
>
>
> > .bbfields <- blpReadFields("C:/Program Files/blp/API")
> >
> > ## Not run:
> > conn <- blpConnect()
> >
> > ## Snapshot
> > eda <- blpGetData(conn, c("ED5 Comdty","ED6 Comdty","ED7 Comdty",
> + "ED8 Comdty"), "BID")
> > eda
>              BID
> ED5 COMDTY 96.860
> ED6 COMDTY 96.680
> ED7 COMDTY 96.475
> ED8 COMDTY 96.330
> >
> > ## Historical (last 30 days)
> > edb <- blpGetData(conn, "ED1 Comdty", "PX_LAST",
> + start=as.chron(Sys.time() - 86400 * 30))
> > edb
>         PX_LAST
> 04/08/08  97.530
> 04/09/08  97.545
> 04/10/08  97.500
> 04/11/08  97.540
> 04/14/08  97.495
> 04/15/08  97.440
> 04/16/08  97.290
> 04/17/08  97.120
> 04/18/08  97.090
> 04/21/08  97.125
> 04/22/08  97.125
> 04/23/08  97.135
> 04/24/08  97.145
> 04/25/08  97.135
> 04/28/08  97.195
> 04/29/08  97.245
> 04/30/08  97.325
> 05/01/08  97.330
> 05/02/08  97.365
> 05/05/08  97.350
> 05/06/08  97.365
> 05/07/08  97.365
> 05/08/08  97.395
> >
> > ## Intraday bars (last hour in 2 min bars) edc <- blpGetData(conn,
> > "ED1 Comdty", c("BID","ASK"),
> + start=as.chron(Sys.time() - 3600), barfields="OPEN", barsize=2)
> > edc
>                    BID.OPEN ASK.OPEN
> (05/08/08 09:26:21)       NA       NA
> >
> > ## Tick-by-tick (3 minutes starting an hour ago) edd <-
> > blpGetData(conn, "ED1 Comdty", c("BID"),
> + start=as.chron(Sys.time() - 3600),
> + end=as.chron(Sys.time() - 3420), barsize=0)
> > edd
> Error in substr(text, first, last) : invalid substring argument(s)
> >
> > blpDisconnect(conn)
>         used (Mb) gc trigger (Mb) max used (Mb)
> Ncells 291899  7.8     531268 14.2   408779 11.0
> Vcells 610228  4.7    1151091  8.8  1151024  8.8
> > ## End(Not run)
> >
> > help(blpDisconnect)
> >
>
>
> Jorge Nieves
>
>
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>

       [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.

_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.



More information about the R-SIG-Finance mailing list