summaryrefslogtreecommitdiffstats
path: root/bandit.R
diff options
context:
space:
mode:
Diffstat (limited to 'bandit.R')
-rw-r--r--bandit.R10
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"))
+}