The Portfolio Backtests tool allows you to backtest not the particular static portfolio but the very strategy you are going to use. This is extremely helpful in determining whether your scoring model's criteria are sound or need further adjustments.
Before you move forward, ensure you fully understand the difference between Portfolio and Strategy Backtests. Please spend a few minutes of your time and read this article: How our backtests actually work.
How to backtest your strategy?
To backtest a strategy, you need first to build one. That means you should have at least one Scoring Model set up and running (or you can also use one of ours if you wish to check its performance).
Open the backtesting workspace by selecting the Backtests tool from the top menu and then clicking the Strategy Backtest tab.
Phase 1: The initial settings
Make sure that you're about to backtest the right strategy (right scoring model). If not, switch to the desired model in the upper left corner.
To run the first phase of the backtests, you need to provide a few things:
- Strategy (aka scoring model) you want to backtest – upper left corner
- The pool of companies that you want to backtest within that strategy
- Start and end date of desired backtesting period
- Historical Data Interval to tell our algos how often they should calculate scoring changes
Let's dig into these.
This is a scoring model (investing criteria) that you want to backtest. Now there's the question: what pool of companies will you try these criteria on? You can't do backtests on all 37k+ companies (not yet) because it would take ridiculously long. It's a necessity to narrow the investing universe beforehand. Hence, the first step might be to pre-select companies for your strategy by using a Screener and/or to add some interesting companies manually.
Whatever way you've chosen, until that point, you probably have some Companies added to at least one of your scoring models. Here, in the above example, we have a scoring model called Ohlson vs. Altman, and we also want to test it on 305 companies that we had added to that strategy some time ago.
That actually is the most common use case among our clients.
But... there is also another option. If you don't have your companies added to any scoring model yet, you can select from the dropdown menu the: Historical S&P 500 Constituents and do your backtests on the companies that were active in the S&P 500 index during the whole time that you were going to do your backtests.
This is known as a rolling backtest and is the most objective and reliable way of doing backtests. You can read more about it here.
Start and End Date
These are the time thresholds for doing a backtest to see how your strategy performed in the past periods. The furthest back in time you can go is 01/06/2006 as a Start date and the current date as an End date.
That said, we do not really recommend drawing any conclusions based on observations made so many years ago. The most reliable way to draw any conclusion is to backtest your strategy for 5-10 years. Today's market doesn't look or behave as the market did in 2006.
Historical Data Interval
This parameter is intertwined with rebalancing periods. When doing backtests that start on the 1st of June 2006, our systems will fetch the historical data that was accurate back then and simulate the trades based on that.
Nonetheless, to make this simulation as real as possible, the system must also assume that the data (like EPS estimates, Revenues, Price Targets, etc.). is changing over time. Keeping that in its algorithmic mind, our system will repeat the process of fetching the new data and reassessing all companies every month.
It may fetch the data snapshot as it was valid on the 1st of June 2006, then on the 1st of August 2006, then on the 1st of September 2006, and so on, up until today.
Based on that mechanism, the simulation of your trades will always look similar to the analysis and conclusion based on the data available back then, without any hindsight bias.
So, the Historical Data Interval basically tells our system how often it should update the historical data and suggest rebalancing your historical portfolio on that basis.
The one-month interval is the most accurate, but it will result in a longer waiting time for all the calculations and demand higher turnover in your portfolio. The one-quarter interval will do the backtest quicker, but it can miss some crucial development of the data during the three-month blackout period.
Basically, you should ask yourself how often you would rotate your portfolio if you were investing manually. More like every month of every quarter? By answering this question, you'll know which option to choose.
When all parameters are set, we can finally calculate the data. It'll take some time, depending on the length of the period chosen and the data updating frequency, but let's click the purple button and see what happens.
Phase 2: Detailed backtest parameters
When the historical data is fetched, it's time to fine-tune every detail before we can see the results.
- Start date, End Date – in this example, we've calculated the data for the 2013-2023 period with one-month intervals. We can now do the backtest with these exact parameters or narrow them to, for example, the 2020-2023 period or 2022 year alone. It won't require fetching the data again because the whole set (2013-2023) is now downloaded and calculated.
- Rebalancing Frequency – again, we've already processed the data in one-month intervals, but if you'd like to test different rebalancing frequencies, you can try them out here. In most cases, however, a one-month rebalancing frequency will be the best one.
- Portfolio Size – we've already calculated data for the 305 companies added to your strategy and ranked them from the best to the worst, but actually, how many of "the best ones" would you like to keep in your portfolio? The TOP 20 or TOP 50? In most cases, something between 25-30 will be optimal.
- Asset Allocation – how would you like the weights of your stocks to be determined? Based on what criteria? If you're not sure, leave the Equal Weights option turned on. Nevertheless, it's worth toying a bit with different settings because sometimes the risk-based weights yield a higher risk-to-return ratio.
- Required Years since IPO – it is important to set the threshold of at least 2-3 years when backtesting scoring models stuffed with rules calculated on the metric's historical range (for example, P/S or Upside). If you allow companies without historical data (they've just debuted on the stock exchange), we won't be able to calculate the historical ranges correctly. On the other hand, when you decide to remove the companies that do not meet this criterion, we'll not eliminate them completely, but we'll move them to the very end of the ranking. Quality or quantity? It's your choice.
We're almost done. There is one more important thing to consider.
Tolerance for Low Scores & Missing Data
What about companies that do not have full fundamental data allowing us to calculate their scoring? Imagine the scoring model with 30 different rules. Very often, some companies won't have the data available for some indicator. Should we tolerate that or not? What if some data is available indeed, but it's really poor compared to the rest of the companies?
You need to tell our algorithms how they should treat companies with low scores or missing data. You have four options (Low, Medium, High, and Full tolerance)
- Low tolerance means that the company can't have more than 30% of missing or poor data (the data is considered poor when its total rules scoring is less than 40%)
- Medium tolerance means the company can't have more than 45% of missing/poor data.
- High tolerance means that no more than 75% can be missing or poor-quality data
- Full tolerance means we'll take into consideration all stocks regardless of the quality or lack of their data.
When doing a backtest of decent scoring models with more than ten different rules and more than 300-400 good companies added to your strategy, choose Low tolerance. This will reduce the number of companies that scored high but will also enhance the scoring quality.
When backtesting only one or two rules in a strategy or doing backtests on less than 300 stocks, use the High tolerance because otherwise, we might not be able to find your TOP 30 stocks meeting the strict criteria.
Scrolling down allows you to find additional backtests criteria. Expand the Advanced Settings, and you'll see there:
- Initial Portfolio Value – you can put there whatever amount you want to simulate your potential results even closer
- Reduce Portfolio Turnover – check this box to avoid overtrading by rotating the companies too often even though their scoring hasn't changed that much. When checked, we will simulate rotating companies in your portfolio only when the difference between the good and bad ones is more than 1% of their total scoring.
Scroll down further to see the optional Buy and Sell Criteria.
Buy and Sell criteria
By default, our backtest machine will simulate that you always have 100% of your cash allocated to the TOP 30 best stocks according to their current ranking position that is updated every month (or to the 25 stocks, or whatever number you've chosen). It doesn't matter how high or low the score of the last company on your TOP 30 list is because it will always be a part of your portfolio as a thirtieth the best stock.
If you want to overwrite that rule and, let's say, have in your portfolio the 30 best companies BUT ONLY when their scoring is, for example, higher than 70%, or the upside is greater than 50%, or whatever other condition is met, you can set it here in the Buy Criteria.
The same applies to the Sell Criteria. By default, we'll simulate selling out the stock only if it's not one of the TOP 30 companies anymore (we check for that monthly). Nevertheless, you might want to define your own criteria for selling stocks, for example, when the Upside is lower than 5% or something similar.
By the way, you can set the additional criteria here only if they are already preconfigured in your scoring model. That's because we need to have them already recalculated for you to simulate the historical trades.
Bear in mind that in most cases, it's better not to set any additional Buy and Sell Criteria but rather allow the system to keep your cash fully allocated all the time in 20 or 30 of the best stocks we can find for you.
When everything is set, click the Run Backtest button, hold your breath, and... interpret the backtest results.