As you may know the Quant Investing stock screener also lets you to back test your investment strategy using point in time data.
This article shows you how to back test your investment strategy with a real world example.
Download the spread sheet
Important - You can download the spread sheet with all of the back test data and calculations – it’s at the bottom of the article.
Back test of the Magic Formula Momentum investment strategy
This article shows you a back test of the Magic Formula combined with momentum (Price Index 6 months) investment strategy in Europe over the four year period from January 2016 to December 2019.
It is a further back testing of this investment strategy: Magic Formula investing & Price Index 6m momentum investment strategy
If you have not used the stock screener before this article shows you exactly how to get stated: Quant Investing Screener Quick Start Guide
Back test data is available from 4 December 2015.
The exact screener settings
Here are the details of the back tested investment strategy:
- Countries - 17 Eurozone countries (Austria, Belgium, Cyprus, Estonia, Finland, France, Germany, Greece, Ireland, Italy, Luxembourg, Malta, the Netherlands, Portugal, Slovakia, Slovenia, and Spain)
- Exclude banks, insurance companies, investment funds, certain holdings companies, and REITS
- Exclude companies with an average 30-day trading volume of less than €10,000
- Portfolios formed on the first trading day of the year (Because the back test database is point in time there is not risk of look-ahead bias)
- Returns were compounded on an annual basis
- Select the 20% best ranked Magic Formula companies
- Sort the list by Price Index 6 months from high to low
- Buy the top 50 companies by Price Index 6 months on an equal weight basis
- Rebalance after one year
This is what the screen looks like.
How to screen the past - back test
This is how you set up a back test.
I expand on all the points below but here are the steps if you know the screener:
- Login and go to the screener
- Set up or load a screen
- Click on the Historical Screener icon
- Select the date in the past from where you want the screener results for
- Select the future closing price date to where you want to calculate returns
- Click Confirm to get the historical screener results
Detailed back test steps
Here are the detailed steps to back test your strategy.
1. Login and Set up or load a saved screen
For instructions on exactly how to log in and set up a screen look at this article: How to run your first screen with the Quant Investing screener
2. Get historical results of your screen
Once you have run your screen and you have a list of companies that currently fit the screen criteria you are ready to go back in time.
To do this click on the Historical Screener icon to open the Historical Screener date selector.
A window will the open where you can select two dates.
The first date is the date in the past you want to the screener to run and give you investment ideas. The closing stock prices on this date will automatically be added.
You can also (you do not have to) select a second closing price date.
If you add a second date the Screener will automatically calculate the stock price percentage change from the first date to the second closing price date.
For example , if you choose to run the historical screener on 3 January 2016 and enter 30 June 2016 as the second date the screener will automatically calculate the stock price return from 3 January 2016 to 30 June 2016 for you.
This makes it easy to see how your investment strategy has performed.
To select the past date you would like to screen for click the top date selector icon.
To select a date you can either click the blue left arrow or click on the date heading as shown below.
Next select a second closing stock price date.
The Historical Screener will calculate returns from the above selected screener date to this date.
After selecting the date click the Confirm button to start the historical screen.
That is all you have to do to back test or screen past results.
If there is "No Data"
As you saw you can only select weekdays. However it may be that the day you selected was a market holiday with no stock prices.
If it was a market holiday you will see a "No data" message like this:
If you get the No data message simply select a weekday before or after the date you selected.
What were the returns of your back test?
The results of your back test will look like this (number explanation below):
Click image to enlarge
- Shows you what saved screen you are back testing
- Shows you the date you are back testing (companies that fit your screen on that date)
- Shows you the saved Template you are using. A Template is a saved collection of columns displayed with a screen.
- The closing price on the date you are back testing. The date shown in 2.
- The second closing price date you selected.
- The percentage change from the closing price in 2 to the closing price in 5.
If the returns look unusual
If the returns of companies in your back rest look unusual, -100% or no return for example. You will have to do a bit of research to make sure the test data is correct.
Export to Excel for more calculations
If you want to calculate more return numbers remember you can export the above results to Microsoft Excel.
To export to Excel just click on the Export Data to MS Excel icon.
Getting back the Magic Formula investment strategy back test
Getting back to how the Magic Formula Momentum investment strategy performed.
Here are the summarised results:
You can see the strategy performed well in 2016 and 2017 but did not beat the market (EURO STOXX® Index) on a CAGR basis.
This was mainly because of the 2018 loss of 26%.
Here is your back test spread sheet
Click on the link below to download the spread sheet with the Magic Formula Europe investment strategy back test:
That is how easy it is for you to back test your investment strategy.
PS Not a subscriber to the Quant Investing stock screener and back tester yet? Sign up here.
PPS Why not sign up right now before it slips your mind?