[R-SIG-Finance] Gaps in time for yahoo historical quotes?
Jeff Ryan
jeff.a.ryan at gmail.com
Mon Nov 17 17:51:36 CET 2008
Marc,
In terms of data you get what you pay for.
even then... :)
If you want, quantmod's getSymbols can fetch google financial data,
which is split adjusted.
getSymbols("AAPL", src="google")
You can also set that as your default:
library(Defaults) #included by default
setDefaults(getSymbols, src='google')
getSymbols("GENZ")
str(GENZ)
do read the help at ?getSymbols.google for a warning about google data.
HTH
Jeff
On Mon, Nov 17, 2008 at 10:38 AM, Marc Delvaux <mdelvaux at gmail.com> wrote:
> I am trying to get historical quotes from Yahoo. Ideally I want high
> quality split and dividend adjusted close prices for a set of stocks.
> My history so far:
> - I started with yahooSeries in pacjage fImport. This would be ideal,
> but it does look like the series is for non adjusted data. I didn't
> find any function to adjust the serires yet, is there any.
> - I then used getYahooData in package TTR. This has the split
> adjusted values I want, but it seems that the returned data series
> don't always have the same dates present. The series are OK for the
> near past, up to about 1600 points, but some series become
> incompatible later on. A quick illustration of the problem is shown
> below, but many series are affected in that way. Anybody that already
> faced that problem and came with a solution to get compatible series?
> It is not a real problem if you are using only one series, but is a
> serious problems when comparing series.
>
>> aapl <- getYahooData("AAPl", 19910101, 20080101)
> End date out of range, 2007-12-31 is last available date.
> Start date out of range, 1991-01-02 is first available date.
>> genz <- getYahooData("genz", 19910101, 20080101)
> End date out of range, 2007-12-31 is last available date.
> Start date out of range, 1991-01-02 is first available date. << GENZ
> and AAPL report same start and end date
>> dim(genz)
> [1] 4279 10
>> dim(aapl)
> [1] 4285 10 << but different number of samples
>
> After some manipulations, including reverting the time order
>
>> aapl[1488:1490,]
> Date Open High Low Close Volume Unadj.Close Div Split Adj.Div
> 523 2002-02-04 12.16 12.760 12.100 12.675 18656200 25.35 NA NA NA
> 522 2002-02-01 12.17 12.480 12.170 12.205 14225200 24.41 NA NA NA
> 521 2002-01-31 12.08 12.365 12.055 12.360 16730200 24.72 NA NA NA
>> genz[1488:1490,]
> Date Open High Low Close Volume Unadj.Close Div Split Adj.Div
> 517 2002-02-04 46.45 46.50 43.30 44.04 5297000 44.04 NA NA
> NA << where is 2002-02-01 ?
> 516 2002-01-31 44.70 46.49 44.22 45.61 4983100 45.61 NA NA NA
> 515 2002-01-30 45.89 46.00 40.69 44.46 13818300 44.46 NA NA NA
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
--
Jeffrey Ryan
jeffrey.ryan at insightalgo.com
ia: insight algorithmics
www.insightalgo.com
More information about the R-SIG-Finance
mailing list