Hi,
I've shared some code to compare Yahoo and Q 12-month rolling returns. The objective is to get something clean to investigate and derive conclusion on that matter.
Frank, I've shared an example of the paired_switching strategy where I've modified the code to easily change for signals to be generated from either Yahoo or Q.
Ed, I was not aware of that limitation. Eventually you could process your universe at night, upload that results in a single CSV and fetch it the next day considering FETCH is applied a hour before NY market open if I remember well. And if I may, I would use the R package to make sure the data is consistent as presented thereafter.
In the below R code, I basically show that for get 'split' only adjusted prices, I recalculate things as the 'adjust=c("split")' does not deliver as expected (or I don't use it correctly)
library(quantmod)
symbols <- c("MSFT")
from <- "2000-01-01"
to <- "2013-12-31"
par (mfrow=c(2,3))
for (i in 1:length(symbols)) {
getSymbols(symbols[i], from=from, auto.assign=TRUE)
plot(Cl(get(symbols[i])), main=symbols[i], type="p", pch=20)
}
# use.Adjusted=FALSE (the default), the function pulls the split and dividend data from Yahoo and calculates the ratios manually
getSplits("MSFT")
getDividends("MSFT")
splitdiv = symbols
split = symbols
# adjust for splits and dividends
for (i in 1:length(symbols)) {
assign (splitdiv[i], adjustOHLC(get(symbols[i]),
adjust=c("split", "dividend"),
use.Adjusted=FALSE,
symbol.name=symbols[i]))
}
# plot adjusted series
for (i in 1:length(symbols)) {
plot(Cl(get(splitdiv[i])), main=paste0(splitdiv[i],".split-div"), type="p", pch=20)
}
# adjust for splits
for (i in 1:length(symbols)) {
assign (split[i], adjustOHLC(get(symbols[i]),
adjust=c("split"),
use.Adjusted=FALSE,
symbol.name=symbols[i]))
}
# plot adjusted series for slipts only
for (i in 1:length(symbols)) {
plot(Cl(get(split[i])), main=paste0(split[i],".split"), type="p", pch=20)
}
getSymbols('MSFT', to=to, from=from)
div <- getDividends('MSFT')
spl <- getSplits('MSFT')
adj <- na.omit(adjRatios(spl, div, Cl(MSFT)))
price_split <- MSFT
price_split[,1] <- price_split[,1] * adj[, "Split"] # * adj[, "Div"]
plot(price_split)
price_splitdiv <- MSFT
price_splitdiv[,1] <- price_splitdiv[,1] * adj[, "Split"] * adj[, "Div"]
plot(price_splitdiv)