Last Updated on April 26, 2018 by Mark Ursell
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 valuable resources.
Why Should I Backtest?
Backtesting is hard work. It is difficult to get right and easy to make a mistake. You need to learn the technical skills as well as avoid risks like hindsight bias and curve-fitting.
For many people the thought of spending time learning how to backtest is frightening. However, I have written many times that backtesting is probably the most essential part of trading success.
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. Carrying out this process gives you confidence in your methods, it allows you to test and develop your ideas and learn about new markets in a safe environment.
If you do not backtest you are at the mercy of the financial talking heads, internet ‘trading gurus’ and possibly even your own emotions.
Tradinformed Backtest Models
If you are looking for a backtesting method, Tradinformed Backtest Spreadsheets are built in Excel. They use standard Excel formulas and are an excellent way to use historical price data to test your trading strategies. You can find the latest models in the Tradinformed Shop.
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 type 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
Some 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 not 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 vast 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 enormous 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 largest 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 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 discussed here feel free to comment below.