[R-sig-finance] import.data.bloomberg interface

davidr at rhotrading.com davidr at rhotrading.com
Thu Oct 21 20:57:31 CEST 2004


This much is on the web:

import.data.bloomberg(topic, security, fields, flag,type, start.date, end.date, periodicity, chron.order, pathNameToServer)

This is not the greatest design ever (well, neither is the Bloomberg API, etc.) It is also incomplete, using just the DDE server rather than the API, so historical intraday data is not available (a shortcoming I would hope someone could improve for R.)

There are also examples such as:
--------------------------------------------------------------
Summary of Replies on how to get splits from splus / bloomberg
from [Clark Sims]
[Bookmark Link][Original]
To: 
s-news at wubios.wustl.edu, Matt.Kurbat at kmv.com
Subject: 
Summary of Replies on how to get splits from splus / bloomberg
From: 
"Clark Sims" <clarksimssplus at my-deja.com>
Date: 
Thu, 5 Jul 2001 13:40:12 -0700

The following command gets splits for IBM

temp.data <-  import.data.bloomberg("Bulk", "IBM Equity", "Eqy_Dvd_Hist_Splits")

column 1:  declared date
column 2:  ex date
column 3:  record date
column 4:  pay date
column 5:  split ratio

Thanks To Steve Wisdom

HTH,

Clark
--------------------------------------------------------------
Maybe they'll sue me for publicizing this, but surely it's out on the net somewhere:

DESCRIPTION

Import data from a Bloomberg database into an S-PLUS data sheet.

USAGE

import.data.bloomberg(topic, security, fields, flag, type,
     start.date, end.date, periodicity, chron.order, pathNameToServer)

REQUIRED ARGUMENTS

topic 	character string specifying a Bloomberg data category, one of "Historical", "Market", or "Bulk".
	security	character string containing a comma-separated sequence of Bloomberg security IDs, or a character vector of such IDs. For example,  "IBM US Equity, F US Equity" or c("IBM US Equity", "F US Equity").
	fields	a character string containing a comma-separated sequence of field mnemonics from the Bloomberg data dictionary, or a character vector of such mnemonics. For example, "Px High, Px Low" or c("Opt chain", "eqy dvd hist")
. 

OPTIONAL ARGUMENTS

flag	a character string containing any special flags that apply to your query. See the Bloomberg documentation for more details.
	type 	a character string describing the type of security identifier that can be specified in the DDE link, such as "AIBD, VALOREN". The default value is "".
	start.date	number giving the start date, or the character string "Now". The Bloomberg date format is yyyymmdd.   For example: 19980101, 19960520. 

stop.date 	The end date (see start.date for format).
	periodicity	character string giving the frequency of the requested data. Can be one of: "Day", "Week", "Month", "Quarter", or "Year".
	chron.order	character string specifying the order in which to sort the data, either "Chronological" or "Reverse".
	pathNameToServer	a character string containing the path to BLP.EXE. This should not need to be set unless you have trouble accessing the server, in which case you can specify an explicit path.

VALUE

a data sheet containing the requested data. 

SEE ALSO

import.data, import.data.mim, import.data.fame.

EXAMPLES

IBM.DS<-import.data.bloomberg("Historical", c("IBM Equity", "F Equity"),

      c("Px Last","Px high"), "","",19990501, "Now",

      "Day","Chronological","BLP.EXE")

IBM.DS.M<-import.data.bloomberg("Market", c("IBM Equity", "F Equity"),

      c("Px Last", "Px high", "Px Low"), "","","Now", "Now", "Day",

      "Chronological","BLP.EXE")

David L. Reiner
 
Rho Trading
440 S. LaSalle St -- Suite 620
Chicago  IL  60605
 
312-362-4963 (voice)
312-362-4941 (fax)
 



More information about the R-sig-finance mailing list