One of the questions that I am asked most often is: where can I get free online historical price data?
In this article I look at some the best sources of free online data. I give my thoughts on why each source is useful, pitfalls to avoid and links to some useful resources.
Why Should I Backtest?
Backtesting is looking back over the historical records to see what has worked in the past. We use this process to test ideas, refine our understanding of the markets, and develop trading strategies. I have written many times that I believe that backtesting is probably the most important part of trading success.
If you are looking for a backtesting method. Tradinformed Backtest Spreadsheets are built in Excel. They use standard Excel formulas and are an easy way to use historical price data to test trading strategies.
The easiest and most obvious source of data for most people is your broker. The advantage of using your broker’s data is that it will be exactly the data you use for trading.
Pretty much every broker provides data in the form of price charts. The most basic form of backtesting is to use these charts and mark on the entry and exit points of the trades. The problem with using charts to backtest is that it is time-consuming.
Export Directly From the Broker
A number of brokers allow you to use their price data. Platforms such as TradeStation and NinjaTrader allow you to export the data directly from your trading terminal.
Other brokers, such as IG, allow you to export data using an API. If you use IG you can view my YouTube video explaining the process here: How to Download Historical Data from IG.
For forex traders, one of the easiest and best ways to get currency price data is from MT4. MT4 is a simple platform that has been around since 2005. The platform is free and widely used and has the ability to backtest and run automated strategies. I have written previously about how you can create your own automated EA.
Another big advantage of MT4 is that you can easily export data from the terminal. If you want to try this out, sign up for a free demo account. Click on Tools – History Center and you can see all the data available in your terminal. These days most brokers offer a wide range of CFD markets so you are no limited to forex markets. But be warned that the data varies between brokers.
Yahoo Finance is a treasure trove for traders and backtesters. It not only covers a huge range of markets, but the price data goes back a long way in history. Incredibly, Yahoo Finance was only launched in 2007.
Apart from the huge amount of news and current prices you can download historical data directly from the website by clicking on the Historical Data tab. Select your dates and then click Download Data.
Yahoo Finance offered direct access to the historical data through the Yahoo API. But as from May 2017 this access has been removed and it is not certain what will replace it.
Problems with Yahoo Data
All historical data can have errors. But I would say that Yahoo Finance data tends to have more than most. These errors can easily bias a historical test. I have noticed missing data points, mysterious changes in the price and occasionally whole data series are removed from the site.
Given the huge amount of free data, these errors are understandable. I recommend a combination of automatic and manual spreadsheet tests to make sure that your results are reasonable. It is easy to set up formulas that will check for errors like big changes in prices. Other errors can be picked up by manually checking your results. Always check the biggest winning and losing trades to see if there are any problems with the data.
Like seemingly every part of our lives, Google has penetrated the world of finance data. I now find myself using Google Finance more and more. In my eBook How to Develop a Trading Strategy I talk about the ease and simplicity of the Google Finance Stock Screener. I also make use of the Portfolio facility to keep an eye on my stocks.
Integrate with Google Sheets
One of the most useful parts of Google Finance is how it is integrated into Google Sheets. Sheets is Google’s online spreadsheet system. I now use Sheets to automatically run the calculations for my trading strategies. I absolutely love this because it allows me to monitor all my strategies in real time from my computer or phone. If you want to see how I do this check out my article: Import and Store Live Price Data in Google Sheets.
There are other online sources of data that I have not mentioned. Some paid for data providers, like QuantQuote, also offer some free stock price data. If you have any other sources that are not mentioned here feel free to comment below.