| Download Free Historical Quotes from Yahoo Finance |
|
|
The script below will download FREE Historical Stock Quotes from Yahoo Finance base on the list of stock quotes you entered. Most of the websites out there offer you to Historical Quotes download but you have to pay for it. In eTraderZone, we are not only show you how to download FREE Historical Quotes, but also give you the source code so that you can modify it to suit to you own needs.
By default 5 years daily data will be downloaded but you can alter the timeframes. The name of the file is "table.csv" and the data downloaded contains Date, Open, High, Low, Close, Volume and Adj Close, it's in descending order by Date.
http://ichart.finance.yahoo.com/table.csv?s=INTC&a=06&b=9&c=1986&d=2&e=5&f=2008&g=d The URL string above will download daily historical data for INTC (Intel) from 6th of July 1986 (Intel went IPO) until 5th March 2008 into a file call table.csv. b - This parameter is to get the input for the start day, this one quite straight forward, '1' is for day one of the month, '2' is for second day of the month and so on. c - This parameter is to get the input for the start year d - This parameter is to get the input for end month, and again '00' is for January, '02' is for February and so on. e - This parameter is to get the input for the end day f - This parameter is to get the input for the end year g - This parameter is to specify the interval of the data you want to download. 'd' is for daily, 'w' is for weekly and 'm' is for monthly prices. The default is 'daily' if you ignore this parameter. With all the parameters above, you can now construct a URL to download historical prices for any stock quotes you want. But if you are going to download all historical prices for a stock quotes from day one onward (eg: Intel), you don't need to crack your head to look for information such as when is Intel went IPO. You just need to ignore the start and end date as follow: eg: http://ichart.finance.yahoo.com/table.csv?s=INTC If you only specify the start date and ignore the end date, it will download everything right from the start date until the most current prices. eg: http://ichart.finance.yahoo.com/table.csv?s=INTC&a=00&b=1&c=2000
|