diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2011-10-05 00:02:35 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2011-10-05 00:02:35 -0400 |
| commit | fa4db73c36e41f629b0dd325a6a737d3c61cbfd0 (patch) | |
| tree | 1406e6a320395049ed3dbbe2a0d233fbdedecd70 /bandit.R | |
| parent | 30d4aae9ac49a094741fbe36a602510efa3b29d7 (diff) | |
| download | bandit-fa4db73c36e41f629b0dd325a6a737d3c61cbfd0.tar.gz | |
Trying to download the tickers from yahoo
Diffstat (limited to 'bandit.R')
| -rw-r--r-- | bandit.R | 10 |
1 files changed, 10 insertions, 0 deletions
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")) +} |
