summaryrefslogtreecommitdiffstats
path: root/bandit.R
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2011-10-12 14:16:56 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2011-10-12 14:16:56 -0400
commite2aa86813d9ac2cfeb1abe1ad3f699507bae5acb (patch)
tree69782c657d405a17a8085706ea26a582a2ebe65e /bandit.R
parentf5c8bf65078c8d87fa2d510caf7ba793a59ea7c0 (diff)
downloadbandit-e2aa86813d9ac2cfeb1abe1ad3f699507bae5acb.tar.gz
Better fix for the "WAT" bug
Diffstat (limited to 'bandit.R')
-rw-r--r--bandit.R16
1 files changed, 14 insertions, 2 deletions
diff --git a/bandit.R b/bandit.R
index 3482daa..ea77c98 100644
--- a/bandit.R
+++ b/bandit.R
@@ -1,6 +1,18 @@
+#fix bug in adjRatios
+source("patch-adjRatios.R")
+assignInNamespace("adjRatios",adjRatios,ns="TTR")
library(TTR)
-#fix bug in getYahooData
-source("getYahooData.R")
+rm(adjRatios)
+
+tickerlist <- list()
+result <- c()
+for(i in 479:500){
+ ticker <- sp500[i,"ticker"]
+ test <- getYahooData(ticker,"20000101")
+ test2 <- getYahooData2(ticker,"20000101")
+ result <- c(result,test$Close[1]-test2$Close[1])
+}
+
sp500<- read.table("sp500 tickers 10-04.csv",sep="\t",header=T,quote="",colClasses="character",strip.white=T)
colnames(sp500) <- c("name","ticker")
#replace / by -