[R-SIG-Finance] getSymbols problem in quantmod

Costas risk2009 at ath.forthnet.gr
Thu Dec 16 15:42:12 CET 2010


Dear Josh,

Under windows:

Package: quantmod
Type: Package
Title: Quantitative Financial Modelling Framework
Version: 0.3-15
Date: 2010-12-01
Author: Jeffrey A. Ryan
Depends: Defaults, xts(>= 0.7-5), zoo, TTR(>= 0.2), methods
Suggests: DBI,RMySQL,RSQLite,timeSeries,its
Maintainer: Jeffrey A. Ryan<jeff.a.ryan at gmail.com>
Description: Specify, build, trade, and analyse quantitative financial
         trading strategies
LazyLoad: yes
License: GPL-3
URL: http://www.quantmod.com
         http://r-forge.r-project.org/projects/quantmod
Packaged: 2010-12-01 12:35:17 UTC; jryan
Repository: CRAN
Date/Publication: 2010-12-01 14:30:16
Built: R 2.12.0; ; 2010-12-04 13:19:33 UTC; windows

This is what I get:


R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

   Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]

>  library(quantmod)
Loading required package: Defaults
Loading required package: xts
Loading required package: zoo
Loading required package: TTR
>  library(quantmod)
>
>  #setSymbolLookup(^GSPC='yahoo')
>  getSymbols('^GSPC', from='1950-01-01')
[1] "GSPC"
>  tail(GSPC)
            GSPC.Open GSPC.High GSPC.Low GSPC.Close GSPC.Volume
GSPC.Adjusted
2010-12-13   1242.52   1246.73  1240.34    1240.46  4361240000       1240.46
2010-12-14   1241.84   1246.59  1238.17    1241.59  4132350000       1241.59
2010-12-15   1241.58   1244.25  1234.01    1235.23  4407340000       1235.23
<NA>           100.18    100.74    99.36      99.85    13880000         99.85
<NA>            80.86     81.45    80.49      81.10     5070000         81.10
<NA>            18.05     18.05    18.05      18.05     2950000         18.05
>

Best,
Costas

On 16/12/2010 16:32, Joshua Ulrich wrote:
>  Costas,
>
>  Thanks for the session info.  Please tell us which version of quantmod
>  you are using.  I cannot replicate your issue using the latest
>  quantmod from CRAN or from r-forge. I am using Windows XP.
>
>  Best,
>  --
>  Joshua Ulrich  |  FOSS Trading: www.fosstrading.com
>
>
>
>  On Thu, Dec 16, 2010 at 8:29 AM, Costas<risk2009 at ath.forthnet.gr>   wrote:
>>  WRT my previous email, I am using R:
>>
>>  platform       i386-pc-mingw32
>>  arch           i386
>>  os             mingw32
>>  system         i386, mingw32
>>  status
>>  major          2
>>  minor          12.0
>>  year           2010
>>  month          10
>>  day            15
>>  svn rev        53317
>>  language       R
>>  version.string R version 2.12.0 (2010-10-15)
>>
>>  On a windows XP machine....
>>
>>  I seems that the same code in a linux platform (Ubuntu) exhibits no such
>>  problem...
>>
>>  The data downloads ok...
>>
>>  So I assume it is a problem of the windows quantmod library....
>>
>>  I hope this helps...
>>
>>
>>  On 16/12/2010 16:21, Costas wrote:
>>>  Hi,
>>>
>>>  It seems that getting SP500 daily prices before 1980 or so from
>>>  yahoo.finance via the getSymbols() in quantmod becomes problematic:
>>>
>>>>>  getSymbols('^GSPC',src='yahoo',  from='1950-01-03',
>>>>>  return.class='xts');tail(GSPC)
>>>>  [1] "GSPC"
>>>>             GSPC.Open GSPC.High GSPC.Low GSPC.Close GSPC.Volume
>>>>  GSPC.Adjusted
>>>>  2010-12-13   1242.52   1246.73  1240.34    1240.46  4361240000
>>>>  1240.46
>>>>  2010-12-14   1241.84   1246.59  1238.17    1241.59  4132350000
>>>>  1241.59
>>>>  2010-12-15   1241.58   1244.25  1234.01    1235.23  4407340000
>>>>  1235.23
>>>>  <NA>             100.18    100.74    99.36      99.85    13880000
>>>>  99.85
>>>>  <NA>              80.86     81.45    80.49      81.10     5070000
>>>>  81.10
>>>>  <NA>              18.05     18.05    18.05      18.05     2950000
>>>>  18.05
>>>>>  getSymbols('^GSPC',src='yahoo',  from='2010-01-03',
>>>>>  return.class='xts');tail(GSPC)
>>>>  [1] "GSPC"
>>>>             GSPC.Open GSPC.High GSPC.Low GSPC.Close GSPC.Volume
>>>>  GSPC.Adjusted
>>>>  2010-12-08   1225.02   1228.93  1219.50    1228.28  4607590000
>>>>  1228.28
>>>>  2010-12-09   1230.14   1234.71  1226.85    1233.00  4522510000
>>>>  1233.00
>>>>  2010-12-10   1233.85   1240.40  1232.58    1240.40  4547310000
>>>>  1240.40
>>>>  2010-12-13   1242.52   1246.73  1240.34    1240.46  4361240000
>>>>  1240.46
>>>>  2010-12-14   1241.84   1246.59  1238.17    1241.59  4132350000
>>>>  1241.59
>>>>  2010-12-15   1241.58   1244.25  1234.01    1235.23  4407340000
>>>>  1235.23
>>>>>  getSymbols('^GSPC',src='yahoo',  from='1990-01-03',
>>>>>  return.class='xts');tail(GSPC)
>>>>  [1] "GSPC"
>>>>             GSPC.Open GSPC.High GSPC.Low GSPC.Close GSPC.Volume
>>>>  GSPC.Adjusted
>>>>  2010-12-08   1225.02   1228.93  1219.50    1228.28  4607590000
>>>>  1228.28
>>>>  2010-12-09   1230.14   1234.71  1226.85    1233.00  4522510000
>>>>  1233.00
>>>>  2010-12-10   1233.85   1240.40  1232.58    1240.40  4547310000
>>>>  1240.40
>>>>  2010-12-13   1242.52   1246.73  1240.34    1240.46  4361240000
>>>>  1240.46
>>>>  2010-12-14   1241.84   1246.59  1238.17    1241.59  4132350000
>>>>  1241.59
>>>>  2010-12-15   1241.58   1244.25  1234.01    1235.23  4407340000
>>>>  1235.23
>>>>>  getSymbols('^GSPC',src='yahoo',  from='1980-01-03',
>>>>>  return.class='xts');tail(GSPC)
>>>>  [1] "GSPC"
>>>>             GSPC.Open GSPC.High GSPC.Low GSPC.Close GSPC.Volume
>>>>  GSPC.Adjusted
>>>>  2010-12-08   1225.02   1228.93  1219.50    1228.28  4607590000
>>>>  1228.28
>>>>  2010-12-09   1230.14   1234.71  1226.85    1233.00  4522510000
>>>>  1233.00
>>>>  2010-12-10   1233.85   1240.40  1232.58    1240.40  4547310000
>>>>  1240.40
>>>>  2010-12-13   1242.52   1246.73  1240.34    1240.46  4361240000
>>>>  1240.46
>>>>  2010-12-14   1241.84   1246.59  1238.17    1241.59  4132350000
>>>>  1241.59
>>>>  2010-12-15   1241.58   1244.25  1234.01    1235.23  4407340000
>>>>  1235.23
>>>>>  getSymbols('^GSPC',src='yahoo',  from='1970-01-03',
>>>>>  return.class='xts');tail(GSPC)
>>>>  [1] "GSPC"
>>>>             GSPC.Open GSPC.High GSPC.Low GSPC.Close GSPC.Volume
>>>>  GSPC.Adjusted
>>>>  2010-12-09   1230.14   1234.71  1226.85    1233.00  4522510000
>>>>  1233.00
>>>>  2010-12-10   1233.85   1240.40  1232.58    1240.40  4547310000
>>>>  1240.40
>>>>  2010-12-13   1242.52   1246.73  1240.34    1240.46  4361240000
>>>>  1240.46
>>>>  2010-12-14   1241.84   1246.59  1238.17    1241.59  4132350000
>>>>  1241.59
>>>>  2010-12-15   1241.58   1244.25  1234.01    1235.23  4407340000
>>>>  1235.23
>>>>  <NA>             100.18    100.74    99.36      99.85    13880000
>>>>  99.85
>>>  Look at the appended data row under the last dated price.....
>>>
>>>  Why so?
>>>
>>>  Anyone else with the same problems out there?
>>>
>>>  Best,
>>>  Costas
>>  _______________________________________________
>>  R-SIG-Finance at r-project.org mailing list
>>  https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>>  -- Subscriber-posting only. If you want to post, subscribe first.
>>  -- Also note that this is not the r-help list where general R questions
>>  should go.
>>



More information about the R-SIG-Finance mailing list