[R-SIG-Finance] Rbloomberg problem

Robert Sams robert at sanctumfi.com
Fri May 9 11:22:43 CEST 2008


Running David's example on my machine:

> library(RBloomberg)
Loading required package: RDCOMClient
Loading required package: zoo

Attaching package: 'zoo'


        The following object(s) are masked from package:base :

         as.Date.numeric 

Loading required package: chron
Contents of bbfields have been stored in .bbfields in the current workspace
> sessionInfo()
R version 2.7.0 (2008-04-22) 
i386-pc-mingw32 

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

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

other attached packages:
[1] RBloomberg_0.1-10  chron_2.3-22       zoo_1.5-3          RDCOMClient_0.92-0

loaded via a namespace (and not attached):
[1] grid_2.7.0     lattice_0.17-7 tools_2.7.0   
> conn <- blpConnect()
> ex1 <- blpGetData(conn, "ED1 Comdty", c("BID","ASK"), start=as.chron(Sys.time() - 3600), barfields="OPEN", barsize=2)
> ex1
                    BID.OPEN ASK.OPEN
(05/09/08 08:03:00)   97.420   97.425
(05/09/08 08:05:00)   97.420   97.430
(05/09/08 08:07:00)   97.420   97.425
(05/09/08 08:09:00)   97.420   97.425
(05/09/08 08:11:00)   97.420   97.425
(05/09/08 08:13:00)   97.420   97.425
(05/09/08 08:15:00)   97.420   97.425
(05/09/08 08:17:00)   97.420   97.425
(05/09/08 08:19:00)   97.420   97.425
(05/09/08 08:21:00)   97.420   97.425
(05/09/08 08:23:00)   97.425   97.430
(05/09/08 08:25:00)   97.425   97.430
(05/09/08 08:27:00)   97.430   97.440

** CUT **

I can't seem to replicate this. Perhaps the issue is one between the patched R 2.7.0 and RDCOMClient 0.92-0. More likely, I think, is that something has caused the bbcom to crash. THAT has happened to me many times and of course RBloomberg, blp in Excel, etc. will not work. The solution is to restart the server. 

Can you verify that this is NOT the cause of your problem? Can you make the intraday calls in Excel but not R? Do no blpGetData calls work, or is it just the intraday? for some but not other tickers? etc etc.. 

Not much one can do with a problem one cannot replicate and a paucity of relavant information.

Robert

-----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 davidr at rhotrading.com
Sent: 08 May 2008 19:41
To: Ana Nelson; r-sig-finance at stat.math.ethz.ch; Jorge Nieves
Subject: Re: [R-SIG-Finance] Rbloomberg problem


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.

_______________________________________________
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