summaryrefslogtreecommitdiffstats
path: root/bloomberg-data.R
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2011-10-14 01:12:46 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2011-10-14 01:12:46 -0400
commit13b979c5152960458736a33a428b06d6e342ea7a (patch)
treee0c67aa7d550ce7007fb554ae6c4252bce910b0c /bloomberg-data.R
parent2275d3d22d9cc40f2b90ef33d403f2a8535dc7cd (diff)
downloadbandit-13b979c5152960458736a33a428b06d6e342ea7a.tar.gz
Preliminary getBloombergData function
not very robust yet, need to test more corner cases.
Diffstat (limited to 'bloomberg-data.R')
-rw-r--r--bloomberg-data.R9
1 files changed, 3 insertions, 6 deletions
diff --git a/bloomberg-data.R b/bloomberg-data.R
index 92d864a..8118d6c 100644
--- a/bloomberg-data.R
+++ b/bloomberg-data.R
@@ -1,4 +1,5 @@
require(RBloomberg)
+source(getBloombergData.R)
conn <- blpConnect(jvm.params = "-Xmx1024m")
sp500.tickers <- as.character(bds(conn,"SPX Index","INDX_MEMBERS")[,1])
#remove exchange information
@@ -8,15 +9,11 @@ for(i in 1:length(sp500.tickers)){
}
list.sp500 <- list()
-for(i in 1:length(sp500.tickers)){
+for(i in 1:10){
ticker <- sp500.tickers[i]
- list.sp500[[ticker]] <- bdh(conn,paste(ticker,"Equity"),c("PX_OPEN","PX_HIGH","PX_LOW","PX_LAST"),as.Date("2000-01-01"),dates.as.row.names=F)
+ list.sp500[[ticker]] <- getBloombergData(conn,ticker,start.date)
}
-#split information
-EQY_DVD_HIST_SPLITS
-#dividend information
-DVD_HIST
add <- read.table("sp500 add.csv",sep=",",fill=T,header=T,colClasses="character",quote="")
add$date <- as.Date(add$date,format="%m/%d/%Y")