Quantitative finance collector
C++ Matlab VBA/Excel Java Mathematica R/Splus Net Code Site Other
Nov 17

Yahoo chinese historical stock data

Posted by abiao at 18:44 | Others | Comments(9) | Reads(21410)
Wrote a simple script to fetch historical stock data from Yahoo.cn finance and to save as a csv file, please be aware this script is only for those interested into downloading free historical prices of firms listed in Shanghai and Shenzhen stock exchanges only, (indeed not only stock data, but also Chinese warrant data.)  Plese check free real time stock quotes or historial stock price from Yahoo if you prefer non-Chinese stocks.

1, why do I write it since finance.yahoo.com provides such a module already, for instance, by using http://ichart.yahoo.com/table.csv?s=symbol?
Simple, because I found yahoo.com has only closing price dividend-adjusted, which is obviously not enough if your quantitative trading strategies involve historical open, close, high, low data, for example, a widely used stochastic indicator compares current prices to the high and low range over a look-back period, therefore unadjusted high, low data might mistakenly treat a lose strategy as a win strategy. Below are snapshots of stock prces downloaded directly from finance.yahoo.com and from this script, where on 20090610 the stock paid out a dividend.
yahoo chinese stock finance before
yahoo chinese stock finance after

2, you prefer to download historical stock data from Yahoo, dividend info for each stock and adjust the data yourself instead of using this script.
Fine, if you are happy.

3, you have option to download daily, weekly or monthly data using this script, while there is no such an input using http://ichart.yahoo.com/table.csv?s=symbol.
This is another reason I wrote it, please correct me if I am wrong.

How to use the script? by typing the url http://www.mathfinance.cn/yahoo-chinese-stock-quotes.php?stockNo=yourstock&exchange=ss&dateType=yourdate, here yourstock is the symbol of stock to download, ss means shanghai, and sz means shenzhen stock exchange, yourdate has three types: day, week and month for daily, weekly and monthly data, respectively. For instance, http://www.mathfinance.cn/yahoo-chinese-stock-quotes.php?stockNo=600030&exchange=ss&dateType=day will pop up a window asking you to save or open the data in csv. Leave a message here for any error or share with others if it is helpful, thanks.

All stock data is from Yahoo finance China, please obey the policy of Yahoo finance.

The PhP file for this function

Tags: ,
Could you send me your code for a reference? Thanks.
drop me a line and I will send the code to you then.
May I get your codes? Thanks a lot.

My email is:

Sure, I uploaded the file.
can't use.
I didn't notice that, Yahoo finance China has re-organized its website and may changeor close its downloading link, I will update once I sort it out.
Stock Trader Email Homepage
Great tool. There's also a free spreadsheet that will download stocks from yahoo finance in metastock format: www.stockhistoricaldata.com
This is Very useful script to obtain relevant stock information could you please inform me if you have something for forex?
So simple to get around and also it is filled up with numerous tips. All aspects are on place. Could you wish to take a peek at my weblog?
marvel future fight cheats
Pages: 1/1 First page 1 Final page
Add a comment
Enable HTML
Enable UBB
Enable Emots
Nickname   Password   Optional
Site URI   Email   [Register]