From fa4db73c36e41f629b0dd325a6a737d3c61cbfd0 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Wed, 5 Oct 2011 00:02:35 -0400 Subject: Trying to download the tickers from yahoo --- bandit.R | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 bandit.R (limited to 'bandit.R') diff --git a/bandit.R b/bandit.R new file mode 100644 index 0000000..37bdb4a --- /dev/null +++ b/bandit.R @@ -0,0 +1,10 @@ +library(TTR) +tickers<- read.table("sp500 tickers 10-04.csv",sep="\t",header=T,quote="") +colnames(tickers) <- c("name","ticker") +#remove trailing whitespaces +tickers[,"ticker"] <- sub(' +$', '',tickers[,"ticker"]) +#replace / by - +tickers[,"ticker"] <- sub('/', '-',tickers[,"ticker"]) +for(ticker in tickers[,"ticker"]){ + assign(ticker,getYahooData(ticker,"20000101")) +} -- cgit v1.2.3-70-g09d2