go-quote icon indicating copy to clipboard operation
go-quote copied to clipboard

google and tse

Open codingtony opened this issue 6 years ago • 3 comments

Hi,

Congrats for your software, it is very easy to use! I'm trying to get the data for a stock listed on the Toronto Stock Exchange from Google. I tried various combination of way to enter my stock without success. Usually It is referred with a prefix "TSE:" When I try TSE:XSP it does not work. I tried to escape the : with \ without success.

See : https://finance.google.ca/finance?q=TSE%3AXSP&sq=TSE%3AXSP&sp=1&ei=HpmAWtibCdaKe_eLv7AI

codingtony avatar Feb 11 '18 19:02 codingtony

Unfortunately it looks as if historical TSE data is not supported by google.

See: https://github.com/pydata/pandas-datareader/issues/239

However, it does appear to be on yahoo. The symbol is "xsp.to"

A simple "quote xsp.to" should get you some data. Hope that helps.

markcheno avatar Feb 12 '18 01:02 markcheno

Hi Mark,

Thanks for the update.

I did the test on google finance because I did some query that were returning different data using yahoo than the yahoo history (using the web).

I run with -adjust=false (volume and close seems good however) e.g :

quote -start 2016-09-01 -end 2016-09-30  -adjust=false -outfile=test_xsp.to.csv xsp.to

vs

https://ca.finance.yahoo.com/quote/XSP.TO/history?period1=1472702400&period2=1475208000&interval=1d&filter=history&frequency=1d

Is it possible that somehow the -adjust=false gives weird result for the open / high / low ? would it be possible to get the adj_close in a different column and not having to play with -adjust ?

codingtony avatar Feb 13 '18 01:02 codingtony

Unfortunately it seems that the Yahoo data is not longer reliable. They changed the way they were calculating prices and the open/high/low is no longer accurate.

See: http://www.amibroker.com/kb/2017/06/30/wrong-close-price-in-yahoo-data/

In addition, they have been regularly changing their api, apparently trying to prevent people from accessing it. I have stopped using Yahoo data myself and have been using tiingo.com. It is very reasonably priced.

I have not been able to find a reliable reference for calculating the Yahoo correct prices. If you know of any, please let me know and I will try to implement it.

markcheno avatar Feb 13 '18 02:02 markcheno