Adj Close

Dirk Eddelbuettel edd at debian.org
Thu Dec 31 05:16:15 CET 2009


On 30 December 2009 at 20:05, Stphania HOUNGAN wrote:
| Dear Rmetrics Core Team,
| I'm trying to import data from yahooFinance with the function yahooSeries from packages fImport. I want to download “Open”, “High”, “Low”, “Close”, “Volume”, and “Adj Close”. But the function yahooSeries don't allow me to download the adjusted series which is in the last column. How can I download this last column named “Adj Close”? I have R version 2.6.1

Wow, R 2.6.1?  That is _two years_ old. For software that is free to
upgrade. You should consider upgrading.

Anyway, you could try one of the non-Rmetrics packages:

R> library(quantmod)
Loading required package: xts
Loading required package: zoo
Loading required package: Defaults
Loading required package: TTR
R> IBM <- getSymbols("IBM", from="2007-01-01", to="2009-12-30", auto.assign=FALSE, adjust=TRUE)
R> head(IBM)
           IBM.Open IBM.High IBM.Low IBM.Close IBM.Volume IBM.Adjusted
2007-01-03    92.34    93.50   91.47     92.43    9678856        92.43
2007-01-04    92.41    93.87   92.05     93.41   11076148        93.41
2007-01-05    92.74    93.07   92.08     92.57    7599809        92.57
2007-01-08    93.59    94.54   93.45     93.97   10881977        93.97
2007-01-09    94.15    95.33   94.14     95.09   11690443        95.09
2007-01-10    93.59    94.12   93.05     93.96    9203164        93.96
R> IBM <- getSymbols("IBM", from="2007-01-01", to="2009-12-30", auto.assign=FALSE, adjust=FALSE)
R> head(IBM)
           IBM.Open IBM.High IBM.Low IBM.Close IBM.Volume IBM.Adjusted
2007-01-03    97.18    98.40   96.26     97.27    9196800        92.43
2007-01-04    97.25    98.79   96.88     98.31   10524500        93.41
2007-01-05    97.60    97.95   96.91     97.42    7221300        92.57
2007-01-08    98.50    99.50   98.35     98.90   10340000        93.97
2007-01-09    99.08   100.33   99.07    100.07   11108200        95.09
2007-01-10    98.50    99.05   97.93     98.89    8744800        93.96
R> 

As you can see, this can adjust OHLC based on the Adj.Close/Close ratio.

Bonne Annee,  Dirk

-- 
Three out of two people have difficulties with fractions.



More information about the Rmetrics-core mailing list