[R] Bloomberg Data Import to R

2006-02-08 Thread Sumanta Basak
 

Hi R-Experts,

 

Can anyone tell me how Bloomberg data can be directly downloaded to R?
Is there any package?

Sumanta Basak.


---
This e-mail may contain confidential and/or privileged infor...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Bloomberg Data Import to R

2006-02-08 Thread Pfaff, Bernhard Dr.
Hello Sumanto,

your question might be more appropriately been posted to the R-sig-finance
list:

[EMAIL PROTECTED] (I have cc'ed this mail to this list).

To my knowledge neither a function nor a CRAN-package does exist. However,
on the last useR! conference Dirk Edelbuettel presented a proprietary
package that utilised the C API of Bloomberg (type WAPI GO on a Bloomberg
terminal). I am not sure whether Dirk is nowadays inclined or allowed by his
employee to share this package.

As an alternative, you could download data from Bloomberg into Excel, first
(assuming that you are working in a Windows environment) and then load it
into R via RODBC, for example.

Cheers,
Bernhard



Hi R-Experts,

 

Can anyone tell me how Bloomberg data can be directly downloaded to R?
Is there any package?

Sumanta Basak.



---
This e-mail may contain confidential and/or privileged infor...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
*
Confidentiality Note: The information contained in this mess...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Bloomberg Data Import to R

2006-02-08 Thread Vivek Satsangi
Hi Sumanta,

1. This messages is much more appropriate for the sig-finance DL
instead. Consider signing up (I read up on Amba, so I am sure you have
good contributions to make in that forum).

2. To my knowledge, there isn't a direct package. However, if you use
Bloomberg's excel plugin, just get the data into excel, save and then
bring it in as usual. I suspect that that's what you are doing
already.

3. You may have better luck with the S-Plus plugins. I am just getting
started (an don't have any support/maintenace contract), so I don't
know what all Insightful has up its sleeve, but I talked to Carol
Wedekind about this just thing yesterday. Dr. Yollin, who also listens
in on the sig-finance list, may be able to advise you better about
what exists.

With warm regards,

Vivek

Message: 70
Date: Wed, 8 Feb 2006 15:51:13 +0530
From: Sumanta Basak [EMAIL PROTECTED]
Subject: [R] Bloomberg Data Import to R
To: r-help@stat.math.ethz.ch
Message-ID:
   [EMAIL PROTECTED]
Content-Type: text/plain

Hi R-Experts,

Can anyone tell me how Bloomberg data can be directly downloaded to R?
Is there any package?

Sumanta Basak.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Bloomberg Data Import to R

2006-02-08 Thread Neuro LeSuperHéros
Check this out:

https://stat.ethz.ch/pipermail/r-sig-finance/2004q3/51.html

You should consider adapting it with rcom instead of RDCOMClient

Neuro


From: Sumanta Basak [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject: [R] Bloomberg Data Import to R
Date: Wed, 8 Feb 2006 15:51:13 +0530



Hi R-Experts,



Can anyone tell me how Bloomberg data can be directly downloaded to R?
Is there any package?

Sumanta Basak.


---
This e-mail may contain confidential and/or privileged infor...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Bloomberg data import SOLVED

2005-03-31 Thread davidr
Together with Enrique's running start and Prasad's work, we figured out
how to get tick data and bulk data from Bloomberg into R. Here is a code
snippet which builds on Enrique's.


require(RDCOMClient)

blCon - try(blCon - COMCreate(Bloomberg.Data.1), silent=TRUE)
# Always check the class of blCon before proceeding!

# First tick data

ticker - IBM US Equity
fields - c(Last Price,Volume)

comFrom - new(COMDate,38442.458333)
comTo - new(COMDate,38442.58247696760)
z - as.integer(0)

histData - try(blCon$BLPGetHistoricalData(Security=ticker,
Fields=fields, StartDate=comFrom, EndDate=comTo, BarSize=z))

# Notes:
# Passing in just a 0 instead of an int 0 (as z) crashes Rgui
# For tick data, only one ticker is allowed in each call.
# Beware of asking for a long date range; tick data can be very
voluminous.
# I'm sure someone can do some R-magic to fix my start and end datetimes
(please!)

# Bulk data is just like getting prices, except for the return object
being more complex
tickers - c(TYM5 Comdty, USM5 Comdty)
fields - c(FUT_DELIVERABLE_BONDS, FUT_DLVRBLE_BNDS_CUSIPS)
bulkData - try(blCon$BlpSubscribe(Security=tickers, Fields=fields))


Note that my original idea about GetHistoricalData was wrong since that
isn't a function. (At least I couldn't get it to work.)

As a last note, it would be very nice if RDCOMClient were directly
available from CRAN so we could use install.packages, etc. (hint, hint!)

Enjoy,
David L. Reiner

p.s. I know cross-posting is discouraged, but I thought some people
might be looking for this information on r-sig-finance someday.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Bloomberg data import

2005-03-28 Thread davidr
Pasad,
I think GetHistoricalData might work for tick data. (At least it does
from VB and VBA.)
HTH,
David L. Reiner

p.s. Static data was mentioned, and that you get with Subscribe.

-Original Message-
From: Chalasani, Prasad [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 24, 2005 3:10 PM
To: r-help@stat.math.ethz.ch
Subject: RE: [R] Bloomberg data import

Dirk,

the URL for the working binary of RDCOMClient is at the bottom this
page:
http://tolstoy.newcastle.edu.au/R/help/04/11/6759.html

it works with my R 2001.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dirk Eddelbuettel
Sent: Thursday, March 24, 2005 3:00 PM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] Bloomberg data import



Prasad,

Chalasani, Prasad prasad.chalasani at gs.com writes:
 I found that with Enrique's approach it's extremely easy to bang 
 together
 R code to grab historical *daily* data from Bloomberg.
 However when I tried to extend it to to grab Tick/Intraday data, 
 it didn't work. I did look at the Bloomberg ActiveX documentation on 
 my Bloomberg screen, and thought I followed their instructions, 
 e.g I do ( with slight modification of  Enrique's framework ):
 
 dat - '2005-03-22'
 from.t - '10:00:00'
 to.t - '11:00:00'
 # convert date + time to COM format.
 comFrom - as.comDate.Date(as.Date(dat), from.t)
 comTo - as.comDate.Date(as.Date(dat), to.t)
 histData - try(blCon$BLPGetHistoricalData(Security='IBM US Equity', 
 Fields=Last_Price,
 StartDate=comFrom, EndDate=comTo, BarSize=0));
 
 The documentation says that I can get tick data by simply setting 
 BarSize to 0, and using the appropriate field name -- I tried 
 Last_Price, LAST_TRADE, etc but to no avail -- I keep getting some 
 kind of exception.
 
 If someone has any hints as to how to get Tick/Intraday data, that 
 would be nice.

I don't use ActiveX, so take this with a grain of salt. 

Based on the names of functions in the older C interface, I would
conjecture
that the BLPGetHistoricalData() function does not return intra-daily
data.
So you may need to find different functions for the intraday data and
for
the 
static data you were seeking as well. May be worth a try -- report back
here
or on R-SIG-Finance if you succeed.  In any event, whatever you want to
put
together for R via (D)COM has to first work in plain VB, no?

Do you have a current URL for the (D)COM code?  I haven't found it ever
since they had to take their server down after it got attacked.

Cheers, Dirk

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Bloomberg data import

2005-03-24 Thread Chalasani, Prasad
Dear R Folks,

I know that Enrique Bengoechea ( Credit Suisse ) had posted some code
snippets for importing Bloomberg historical data into R.
I found them to be very useful.

Has anyone succeeded in getting the below items
from Bloomberg to R?
(a) historical economic release data,
(b) tick/intra-day data
(c) bulk data such as Index membership info, etc.

If someone is willing to share their code
to get Bloomberg data into R, that would be 
extremely appreciated.

Regards,
Prasad

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Bloomberg data import

2005-03-24 Thread Dirk Eddelbuettel

Prasad,

Chalasani, Prasad prasad.chalasani at gs.com writes:
 I know that Enrique Bengoechea ( Credit Suisse ) had posted some code
 snippets for importing Bloomberg historical data into R.
 I found them to be very useful.
 
 Has anyone succeeded in getting the below items
 from Bloomberg to R?
 (a) historical economic release data,
 (b) tick/intra-day data
 (c) bulk data such as Index membership info, etc.

Yes, I have a package that can do all of the above. See the presentation at
http://dirk.eddelbuettel.com/papers/r_lim_bloomberg.pdf

 If someone is willing to share their code
 to get Bloomberg data into R, that would be 
 extremely appreciated.

Unfortunately the code belongs to my (former) employer and cannot be shared.

That said, with a modicum of effort and knowledge of C programming, you can
replicate the package based on a) the excellent Bloomberg C Api documentation
and examples, and b) the 'Writing R Extensions' manual, as well as your choice
among the 500+ packages on CRAN for concrete C linkage examples.  May be
worthwhile discussing with your IT group.  

Regards,  Dirk

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Bloomberg data import

2005-03-24 Thread Chalasani, Prasad
Dirk,
Yes I am aware of your presentation.
Seems to me your approach is different from the one of Enrique Bengoechea:
you use the C API, whereas he uses the bloomberg ActiveX/COM API ( which
requires the RDCOMClient package 
from OmegaHat -- it doesn't work with R2001, so I actually downloaded Thomas
Baier's build of that package ).

I found that with Enrique's approach it's extremely easy to bang together 
R code to grab historical *daily* data from Bloomberg.
However when I tried to extend it to to grab Tick/Intraday data, 
it didn't work. I did look at the Bloomberg ActiveX documentation on 
my Bloomberg screen, and thought I followed their instructions, 
e.g I do ( with slight modification of  Enrique's framework ):

dat - '2005-03-22'
from.t - '10:00:00'
to.t - '11:00:00'
# convert date + time to COM format.
comFrom - as.comDate.Date(as.Date(dat), from.t)
comTo - as.comDate.Date(as.Date(dat), to.t)
histData - try(blCon$BLPGetHistoricalData(Security='IBM US Equity',
Fields=Last_Price,
StartDate=comFrom, EndDate=comTo, BarSize=0));

The documentation says that I can get tick data by simply setting BarSize to
0,
and using the appropriate field name -- I tried Last_Price, LAST_TRADE, etc
but to no avail -- I keep getting some kind of exception.

If someone has any hints as to how to get Tick/Intraday data, that would be
nice.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dirk Eddelbuettel
Sent: Thursday, March 24, 2005 2:24 PM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] Bloomberg data import



Prasad,

Chalasani, Prasad prasad.chalasani at gs.com writes:
 I know that Enrique Bengoechea ( Credit Suisse ) had posted some code 
 snippets for importing Bloomberg historical data into R. I found them 
 to be very useful.
 
 Has anyone succeeded in getting the below items
 from Bloomberg to R?
 (a) historical economic release data,
 (b) tick/intra-day data
 (c) bulk data such as Index membership info, etc.

Yes, I have a package that can do all of the above. See the presentation at
http://dirk.eddelbuettel.com/papers/r_lim_bloomberg.pdf

 If someone is willing to share their code
 to get Bloomberg data into R, that would be
 extremely appreciated.

Unfortunately the code belongs to my (former) employer and cannot be shared.

That said, with a modicum of effort and knowledge of C programming, you can
replicate the package based on a) the excellent Bloomberg C Api
documentation and examples, and b) the 'Writing R Extensions' manual, as
well as your choice among the 500+ packages on CRAN for concrete C linkage
examples.  May be worthwhile discussing with your IT group.  

Regards,  Dirk

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Bloomberg data import

2005-03-24 Thread Dirk Eddelbuettel

Prasad,

Chalasani, Prasad prasad.chalasani at gs.com writes:
 I found that with Enrique's approach it's extremely easy to bang together 
 R code to grab historical *daily* data from Bloomberg.
 However when I tried to extend it to to grab Tick/Intraday data, 
 it didn't work. I did look at the Bloomberg ActiveX documentation on 
 my Bloomberg screen, and thought I followed their instructions, 
 e.g I do ( with slight modification of  Enrique's framework ):
 
 dat - '2005-03-22'
 from.t - '10:00:00'
 to.t - '11:00:00'
 # convert date + time to COM format.
 comFrom - as.comDate.Date(as.Date(dat), from.t)
 comTo - as.comDate.Date(as.Date(dat), to.t)
 histData - try(blCon$BLPGetHistoricalData(Security='IBM US Equity',
 Fields=Last_Price,
 StartDate=comFrom, EndDate=comTo, BarSize=0));
 
 The documentation says that I can get tick data by simply setting BarSize to
 0,
 and using the appropriate field name -- I tried Last_Price, LAST_TRADE, etc
 but to no avail -- I keep getting some kind of exception.
 
 If someone has any hints as to how to get Tick/Intraday data, that would be
 nice.

I don't use ActiveX, so take this with a grain of salt. 

Based on the names of functions in the older C interface, I would conjecture
that the BLPGetHistoricalData() function does not return intra-daily data.
So you may need to find different functions for the intraday data and for the 
static data you were seeking as well. May be worth a try -- report back here
or on R-SIG-Finance if you succeed.  In any event, whatever you want to put
together for R via (D)COM has to first work in plain VB, no?

Do you have a current URL for the (D)COM code?  I haven't found it ever since
they had to take their server down after it got attacked.

Cheers, Dirk

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Bloomberg data import

2005-03-24 Thread Chalasani, Prasad
Dirk,

the URL for the working binary of RDCOMClient is at the bottom this page:
http://tolstoy.newcastle.edu.au/R/help/04/11/6759.html

it works with my R 2001.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dirk Eddelbuettel
Sent: Thursday, March 24, 2005 3:00 PM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] Bloomberg data import



Prasad,

Chalasani, Prasad prasad.chalasani at gs.com writes:
 I found that with Enrique's approach it's extremely easy to bang 
 together
 R code to grab historical *daily* data from Bloomberg.
 However when I tried to extend it to to grab Tick/Intraday data, 
 it didn't work. I did look at the Bloomberg ActiveX documentation on 
 my Bloomberg screen, and thought I followed their instructions, 
 e.g I do ( with slight modification of  Enrique's framework ):
 
 dat - '2005-03-22'
 from.t - '10:00:00'
 to.t - '11:00:00'
 # convert date + time to COM format.
 comFrom - as.comDate.Date(as.Date(dat), from.t)
 comTo - as.comDate.Date(as.Date(dat), to.t)
 histData - try(blCon$BLPGetHistoricalData(Security='IBM US Equity', 
 Fields=Last_Price,
 StartDate=comFrom, EndDate=comTo, BarSize=0));
 
 The documentation says that I can get tick data by simply setting 
 BarSize to 0, and using the appropriate field name -- I tried 
 Last_Price, LAST_TRADE, etc but to no avail -- I keep getting some 
 kind of exception.
 
 If someone has any hints as to how to get Tick/Intraday data, that 
 would be nice.

I don't use ActiveX, so take this with a grain of salt. 

Based on the names of functions in the older C interface, I would conjecture
that the BLPGetHistoricalData() function does not return intra-daily data.
So you may need to find different functions for the intraday data and for
the 
static data you were seeking as well. May be worth a try -- report back here
or on R-SIG-Finance if you succeed.  In any event, whatever you want to put
together for R via (D)COM has to first work in plain VB, no?

Do you have a current URL for the (D)COM code?  I haven't found it ever
since they had to take their server down after it got attacked.

Cheers, Dirk

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html