[R-SIG-Finance] TSE ticker problems

2012-07-11 Thread Paul Gilbert

I have been having trouble retrieving some TSE series from yahoo:

 require(quantmod)
 getSymbols(BMO.TO, dbname=yahoo)

works but

 getSymbols(COS.TO, dbname=yahoo)

appears to have worked but has actually failed:

 str(COS.TO)
An 'xts' object of zero-width

It seems to be getting the header, but no data. I have also tried with 
Google Finance:


 getSymbols(TSE:COS, dbname=google)
 Error in download.file(paste(yahoo.URL, s=, Symbols.name, a=, 
from.m,  :
  cannot open URL 
'http://chart.yahoo.com/table.csv?s=TSE:COSa=0b=01c=2007d=6e=11f=2012g=dq=qy=0z=TSE:COSx=.csv'

In addition: Warning message:
In download.file(paste(yahoo.URL, s=, Symbols.name, a=, from.m,  :
  cannot open: HTTP status was '404 Not Found'

I'm not sure if I have the syntax correct for indicating an exchange on 
google. Does anyone have suggestions?


Thanks,
Paul

___
R-SIG-Finance@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.


Re: [R-SIG-Finance] TSE ticker problems

2012-07-11 Thread R. Michael Weylandt
Hi Paul,

Are you sure you're not looking for the src= argument of getSymbols()?

Best,
Michael

On Wed, Jul 11, 2012 at 12:49 PM, Paul Gilbert pgilbert...@gmail.com wrote:
 I have been having trouble retrieving some TSE series from yahoo:

 require(quantmod)
 getSymbols(BMO.TO, dbname=yahoo)

 works but

 getSymbols(COS.TO, dbname=yahoo)

 appears to have worked but has actually failed:

 str(COS.TO)
 An 'xts' object of zero-width

 It seems to be getting the header, but no data. I have also tried with
 Google Finance:

 getSymbols(TSE:COS, dbname=google)
  Error in download.file(paste(yahoo.URL, s=, Symbols.name, a=, from.m,
 :
   cannot open URL
 'http://chart.yahoo.com/table.csv?s=TSE:COSa=0b=01c=2007d=6e=11f=2012g=dq=qy=0z=TSE:COSx=.csv'
 In addition: Warning message:
 In download.file(paste(yahoo.URL, s=, Symbols.name, a=, from.m,  :
   cannot open: HTTP status was '404 Not Found'

 I'm not sure if I have the syntax correct for indicating an exchange on
 google. Does anyone have suggestions?

 Thanks,
 Paul

 ___
 R-SIG-Finance@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.

___
R-SIG-Finance@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.


Re: [R-SIG-Finance] TSE ticker problems

2012-07-11 Thread G See
I don't think google provides that data in a nice format (i.e. CSV)

If you go to http://www.google.com/finance/historical?q=NYSEARCA:SPY
you can see that on the right side of the page there is a section
called Export with a link called Download to spreadsheet

However, if you go the analogous page for COS, there is no such link.
http://www.google.com/finance/historical?q=TSE:COS

On Wed, Jul 11, 2012 at 1:57 PM, Paul Gilbert pgilbert...@gmail.com wrote:
 My bad. Indeed the examples should have been:

 getSymbols(BMO.TO, src=yahoo)
 getSymbols(COS.TO, src=yahoo)
 getSymbols(TSE:COS, src=google)

 They lost something in translation from my code. The problem is not resolved
 by this correction, however the yahoo retrieval is fixed by the
 getSymbols.yahoo URL change suggested.

 The google retrieval still causes problems:

 getSymbols(TSE:COS, src=google)
 Error in download.file(paste(google.URL, q=, Symbols.name, startdate=,
 :
   cannot open URL
 'http://finance.google.com/finance/historical?q=TSE:COSstartdate=Jan+01,+2007enddate=Jul+11,+2012output=csv'
 In addition: Warning message:
 In download.file(paste(google.URL, q=, Symbols.name, startdate=,  :

   cannot open: HTTP status was '404 Not Found'


 Any further suggestions appreciated.

 Thanks,
 Paul



___
R-SIG-Finance@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.


Re: [R-SIG-Finance] TSE ticker problems

2012-07-11 Thread Doug Edmunds

On http://finance.yahoo.com/q/hp?s=COS.TO ,
the link to Historical Prices has no data.

Probably why you only get headers.


 getSymbols(COS.TO, src=yahoo)

___
R-SIG-Finance@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.


Re: [R-SIG-Finance] TSE ticker problems

2012-07-11 Thread Jeffrey Ryan
The format that getSymbols uses internally is:

http://chart.yahoo.com/table.csv?s=COS.TOa=0b=01c=2007d=6e=11f=2012g=dq=qy=0z=COS.TOx=.csv

Which somehow doesn't resolve to the data in this instance.  I'll investigate.

Thanks,
Jeff

On Wed, Jul 11, 2012 at 2:42 PM, G See gsee...@gmail.com wrote:
 But... I see plenty of data there...  including a link to Download to
 Spreadsheet
 http://ichart.finance.yahoo.com/table.csv?s=COS.TOd=6e=11f=2012g=da=7b=13c=1996ignore=.csv

 On Wed, Jul 11, 2012 at 2:39 PM, Doug Edmunds dougedmu...@gmail.com wrote:
 On http://finance.yahoo.com/q/hp?s=COS.TO ,
 the link to Historical Prices has no data.

 Probably why you only get headers.


 getSymbols(COS.TO, src=yahoo)

 ___
 R-SIG-Finance@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.

 ___
 R-SIG-Finance@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.



-- 
Jeffrey Ryan
jeffrey.r...@lemnica.com

www.lemnica.com
www.esotericR.com

___
R-SIG-Finance@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.


Re: [R-SIG-Finance] TSE ticker problems

2012-07-11 Thread G See
Paul,

Although, changing the yahoo URL seemed to work to get yahoo's data
for COS.TO, beware that there is a 4+ month gap in their data in 2012.

tail(COS.TO)
   COS.TO.Open COS.TO.High COS.TO.Low COS.TO.Close COS.TO.Volume
2012-02-22   23.25   23.61  23.2323.61   1473800
2012-02-23   23.68   23.75  23.4123.62   1560800
2012-02-24   23.74   23.96  23.6223.66   1639300
2012-02-27   23.60   23.60  23.2623.34   1261100
2012-02-28   23.34   23.70  23.2723.34   2038900
2012-07-11   19.13   19.59  18.9219.40   1286400
   COS.TO.Adjusted
2012-02-22   23.61
2012-02-23   23.62
2012-02-24   23.66
2012-02-27   23.34
2012-02-28   23.34
2012-07-11   23.34

Garrett


On Wed, Jul 11, 2012 at 1:57 PM, Paul Gilbert pgilbert...@gmail.com wrote:
snip
 however the yahoo retrieval is fixed by the
 getSymbols.yahoo URL change suggested.

___
R-SIG-Finance@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.