Historical Stock Data Download (alternate Method)
by Captain Awesome
16 Jul 2012
Retrieves historical stock data from Yahoo Finance by parsing html pages instead of .csv download.
|
Watch this File
|
| File Information |
| Description |
This function is used to retrieve historical stock data from Yahoo Finance. I was using the the 'hist_stock_data.m' by Josiah Renfree (January 25, 2008)and it worked great but I noticed that it stopped working for the Dow Jones Industrial Average Index (^DJI). It turns out that due to some licensing issues, Yahoo is no longer permitted to give ^DJI data out in the .csv form that 'hist_stock_data.m' relied on. As I still wanted access to ^DJI, I hacked together this function to read the data not from .csv, but by parsing the html from displayed tables. Yahoo was still showing ^DJI data in this format.
This function will work with any valid Yahoo listed stock symbol, but will be
slower than 'hist_stock_data.m' because it has to do more work to extract the
data, including potentially reading dozens of pages to get it all. It goes to the first page, extracts the table data and reads the link for the next page of data and continues on till it gets it all. It then cleans it up and returns it in a tidy data structure.
|
| Acknowledgements |
Historical Stock Data Downloader
inspired this file.
|
| Required Products |
MATLAB
|
| MATLAB release |
MATLAB 7.9 (R2009b)
|
| Other requirements |
Requires internet access. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
|
Contact us