Template screens

Guru Screens

Greenblatt Magic Formula

Joel Greenblatt is a successful hedge fund manager and adjunct professor at the Columbia University Graduate school. In 2006 he published the bestseller 'The little book that beats the market', a book he supposedly wrote to teach his children how to make money. In this book he encourages people to take control of their own money and invest it themselves. Most people entrust their money to investment professionals but Greenblatt observes that most of them don't beat the market. They make investing sound quite complicated but as Greenblatt explains, it's actually quite simple. He devised a very straightforward model that can be implemented easily by everyone and has proven to beat the market significantly in the past.

According to Greenblatt, you should be interested in 2 things when investing money into a business:

  1. Paying a bargain price when you purchase a share in a company. One way to do this is to purchase a business that earns more relative to the price you are paying. In other words, you should buy companies with a relatively high earnings yield.
  2. Buying good business rather than bad ones. One way to do this is to purchase a business that can invest its own money at higher rates of return. You should buy companies with a relatively higher ROC.

Combining these 2 points is the secret to make lots of money.

By eliminating companies that earn ordinary or poor returns on capital, the magic formula starts with a group of companies that have a high return on capital. It then tries to buy these above-average companies at below-average prices.

Joel Greenblatt

How do we calculate the magic formula?

The formula is calculated based on 2 ratios:

  1. Earnings Yield = EBIT Enterprise Value
  2. ROIC = EBIT ( Net Fixed Assets + Net Working Capital )

The individual components of this formula are calculated as follows:

Enterprise Value = Market Cap + Total Debt + Minority Interest + Preferred Stock - Cash & ST Investments

Net Working Capital = MAX( Total Current Assets - Excess Cash - ( Total Current Liabilities - ( Total Debt - Long Term Debt ) ) , 0 )

Excess Cash = MAX ( Cash & ST Equivalents - 20% * Net Sales or Revenues , 0 )

Net Fixed Assets = Total Assets - Total Current Assets - Goodwill

Earnings-related numbers are based on the latest 12 months, balance sheet items are based on the latest available balance sheet, and market prices are based on the most recent closing price.

Rank companies based on each of these ratios individually. Make the sum of the results and rank this again.

Magic Formula = Rank ( Rank ( Earnings Yield ) + ( Rank ( ROIC ) )

This formula doesn't work on all companies, so Greenblatt advises to set the following filters:

  1. Set Market Capitalization to a value greater than 50 million dollars.
  2. Exclude utility and financial stocks

Invest in the top 20-30 companies, accumulating 2-3 positions per month over a 12-month period. Re-balance the portfolio once a year. The formula won't beat the market every year, but should do if correctly applied over a period of 3 to 5 year.

Combining the Magic Formula with other value indicators

Studies have shown that combining the Magic Formula with for instance the Piotroski F-Score increases return. If for instance you take the top 20% results of the magic formula and then take the 20% of stocks with the highest 6-month price index, the total return increases from 235% to 784% during the period 1999-2011. You can find more details about this in our latest paper.

Gray & Carlisle Quality and price

In their book ‘Quantative Value: a practitioner’s guide to automating intelligent investment and eliminating behavioral errors’, authors Wesley Gray and Tobias Carlisle discuss some of the most popular quantitative investing screens and factors. For each model, they also present an alternative that outperforms the original model. One of the improved models is what they call ”Quality and Price”. This model is based on the same ranking method as the Magic Formula, but it uses a different quality and price factor. Gray and Carlisle got the idea to replace the factors based on 2 academic papers.


The Greenblatt Magic Formula uses return on capital (ROC) as a proxy of a stock’s relative quality. The problem with ROC is that it’s not a very clean measure of a firm’s profitability. A firm that quickly grows its sales by spending heavily on marketing or R&D will see its short term profitability impacted. Moreover, management can implement actions to increase short term profitability while putting long-term profit growth in jeopardy. In his paper ‘The Other Side of Value: Good Growth and the Gross Profitability Premium’ Robert Novy-Marx suggested to use gross profitability, which is a much cleaner measure of a firm’s true economic profitability. Find more about this measure in our glossary.


The Magic Formula uses EBIT/EV as its price measure to rank stocks. The problem with this measure is that it can vary significantly from period to period. For this reason, Nobel price winner Eugene Fama and Ken French consider book to market capitalization to be a superior metric as it varies less. This is important to keep turnover down in a value portfolio. Find more about this measure in our glossary.

Backtesting results

In their tests, the quality and price model significantly outperformed the magic formula. Between 1964 and 2011, the quality and price model showed an average yearly compound rate of 15.31% compared to 12.79% for the Magic Formula. This model also had higher volatility and worse drawdowns, but on a risk-adjusted basis it was the clear winner.

Return Reversal with Piotroski

In 1670, Isaac Newton concluded that “What goes up must come down”. Centuries later Werner DeBondt and Nobel prize winner Richard Thaler reported in their 1986 article, ’Does the stock market overreact’ in the Journal of Finance, that the same was true for the stock market. Most people tend to overreact to unexpected and dramatic news events and eventually stock prices correct.

They explained the overreaction effect as follows:

“If stock prices systematically overshoot, then their reversal should be predictable from past return data alone, with no use of any accounting data such as earnings. Specifically, two hypotheses are suggested: (1) Extreme movements in stock prices will be followed by subsequent price movements in the opposite direction. (2) The more extreme the initial price movement, the greater will be the subsequent adjustment."

De Bondt and Thaler tested this overreaction hypothesis by focusing on stocks that had experienced either extreme capital gains or losses over the last years. They tested this on data for the period 1926-1982, constructed loser and winner portfolios and evaluated the performance of these portfolios for a period up to 5 years after the portfolio construction. When using a 3-year look-back, the loser portfolio outperformed the market by 19.6% over the next 3 years. The winner portfolio underperformed by 5%. The difference between the loser and winner portfolios was 24.6%. They also examined portfolios formed on a 5-year look-back and found that the loser portfolio outperformed the past winner portfolio by 31.9% over the next 5 years. This phenomenon is also called the winner-loser effect and was the first attempt to apply a test for a behavioral principle to the stock market.

The authors also made the following observations:

  • The effect was assymetric and much less pronounced on winners compared to losers.
  • Most of the excess returns were realized in January. This is more widely known as the January effect.
  • The results confirmed the claim made by Benjamin Graham, that the overreaction phenomenon mostly occurs during the second and third year of the test period.

Glen Arnolds, who published a paper proving the presence of the overreaction effect in the UK, also discovered that returns on the loser portfolio could be further enhanced by applying the Piotroski F-score.

The Return reversal with Piotroski template screen replicates the enhanced loser portfolio by going through the following steps:

  1. First, we select the 10% stocks with the lowest price index over the last 5 years.
  2. Then we filter out stocks with a Piotroski F-score below 6.

Although this theory was later confirmed by papers proving its effectiveness in markets around the world, it's a difficult one to put in practice. In her 1998 Wall Street Journal column headed 'Your money matters: investors' overreactions may yield opportunities in the stock market', Thaler was quoted saying:

It's scary to invest in these stocks. When a group of us thought of putting money on this strategy last year, people chickened out when they saw the list of losers we picked out. They all looked terrible...

De Bondt added:

The theory says I should buy them, but I don't know if I could personally stand it. But then again, maybe I'm overreacting.

Piotroski F-Score screen

Many scientific studies confirm that buying a portfolio of low price-to-book companies will beat the market over time. This makes sense: you buy companies for less than what they're worth on paper. Other experienced investors, however, would argue that book value doesn't always provide an accurate picture of the company value. If you want a better understanding of the real value of the company, a full review of the assets is needed. This is true, of course. But the conclusions of the above studies can't be denied. Furthermore, studying these companies in great detail takes a considerable amount of time and the information necessary to perform an accurate estimate of all assets is not always available to all investors.

Joseph Piotroski, a professor in accounting at the Stanford University Graduate School of Business, had a closer look at the data used in these studies and found that in a portfolio consisting of the lowest price-to-book companies, the profits were generated by only a few stocks. In fact 44% of the companies performed worse than the market. So he thought to himself: wouldn't it be great if I could find an easy way to filter out these companies?

Piotroski wondered whether he could remove these bad apples by looking at the company financial data for the last year. He devised a scoring system called the Piotroski F-Score, a 9 points scoring system based on profitability, funding and operational efficiency. It looks at simple things such as: 'has the company made more profit compared to last year?' (+1 point) but also: 'is the company cooking the books by adjusting accruals?' (0 points). By using 9 points he was able to get enough signals to determine whether the company is really improving or not.

His research showed that his Piotroski F-score helped to predict the performance of low price-to-book stocks. In his backtests he found that this strategy outperformed the market by 10% a year on average between 1976 and 1996. The tests also displayed that this was even more the case for small and medium sized companies. Piotroski attributes to the fact that these stocks are often outside of the radar of analysts and new information about a company doesn't get reflected in the share price as quickly.

You can read his influential 2000 paper by clicking on the following link.

“by selecting low Price-to-Book companies and by filtering out the best companies using a set of accounting signals, one could have generated a 23% average yearly return from 1976 to 1996.”

Joseph Piotroski

Our Piotroski screener selects the 20% lowest price-to-book companies and filters out the ones with an F-score of less than 7.

How do we calculate the F-score?

The F-score is the sum of 9 binary scores in 3 categories:


  1. ROA - Return on Assets: Net income before extraordinary items divided by total assets at the beginning of the year. 1 if positive, 0 if negative.
  2. CFO - Cash Flow Return on Assets: Net cash flow from operating activities (operating cash flow) divided by total assets at the beginning of the year. 1 if positive, 0 if negative.
  3. ΔROA - Change in Return on Assets: Compare return on assets to last year. 1 if it's higher, 0 if it's lower.
  4. ACCRUAL - Quality of earnings (accrual): Compare cash flow return on assets to return on assets. 1 if CFO > ROA, 0 if CFO < ROA.


  1. ΔLEVER - Change in gearing or leverage: Compare the gearing (long-term debt divided by average total assets) to the gearing last year. 1 if gearing is lower, 0 if it's higher.
  2. ΔLIQUID - Change in working capital: Compare the current ratio (current assets divided by current liabilities) to the current ratio last year. A value higher than 1 indicates an increasing ability to pay off short term debt.
  3. EQ_OFFER - Change in outstanding shares: The number of shares outstanding compared to last year. 0 if the number increased, otherwise 1.


  1. ΔMARGIN - Change in Gross Margin: Current gross margin compared to last year. 1 if higher, 0 if lower
  2. ΔTURN - Change in asset turnover: Compare asset turnover (total sales divided by total assets at the beginning of the year) to last year's asset turnover ratio. 1 if higher, 0 if lower.

To calculate this year's number we use the last trailing 12 month (TTM) number available. For last year we use the same number 1 year ago.

F-Score as secondary ratio

The F-Score is often used in combination with other screens. Our tests showed that if you filter the results of the ERP5 screen by only selecting companies with an F-Score of 7 or more, the return increases from 18,66% to 19,5% per annum. (1999-2010). Many of our members also like to use it in combination with the Greenblatt Magic Formula. We added both screens to our templates and called them the ERP5 Best Selection and the Magic Formula Best Selection.

Enhanced Dividend Yield

The enhanced dividend yield strategy was developed by Jim O'Shaughnessy to provide a fixed income strategy based on stocks instead of bonds. O'Shaugnessy argued that while bonds appeal to investors because of their inherent principal protection advantage, they have a number of important disadvantages.

  • First of all, bond yield remains fixed, i.e. you will receive the same coupon over the entire period until maturity. This is ok in periods of low inflation, but between 1970 and 2010 inflation has on average been at 4,45%. That means that something that cost 1 dollar in 1970 costs $5,75 in 2010.
  • Secondly, with bonds your principal doesn't depreciate, but it also won't appreciate. When the bond matures, you will get back the principal amount, and due to inflation this will be worth a lot less.

To remedy these issues of the traditional fixed income strategies, O'Shaugnessy designed a quantitative investing strategy based on stocks, with as primary objectives a growing yearly income combined with capital appreciation. The results of his study show that by implementing the enhanced dividend yield strategy, yearly income would have increased by 10%per annum and between 1962 and 2009, the principal increased by 5538%. What's more, this strategy never had a five-year period in which it lost money, very enticing for risk-averse investors.

How does it work?

O'Shaughnessy created a dividend yield strategy with a twist. Sometimes high yielding stocks are value traps and this strategy tries to get rid of these stocks in 2 ways.

  1. First he limits the stock universe to market leading companies, that accourding to O'Shaughnessy have the following characteristics:
    1. Non-utility stocks
    2. Shares outstanding > dataset average
    3. Cash flow > dataset average
    4. Sales > 1.5 times dataset average
  2. Next he excludes the bottom half of these stocks ranked by their EBITDA/EV. This way he only keeps the 50% of market leaders with the best financial conditions.

Finally, he builds a portfolio in which he overweights the stocks with the highest dividend yield, in the following manner:

  • 25% of stocks with highest yield get 1.5 times the weight,
  • the next 25% by yield get 1.25% the weight,
  • the next 25% get 0.75 the weight,
  • and the final 25 get 0.5 times the weight

The portfolio should be rebalanced every year.

You can read more about this strategy and the results by clicking on this link. This strategy is quite cumbersome to calculate for small investors, but with our screener it becomes a breeze. Just select the high dividend yield template screen, select your countries, and the screener will show the list of stocks for the dataset of the selected countries.

Van Vliet ConservativeFormula

Pim van Vliet is a Dutch portfolio manager for the quantitative equities team at Robeco. He’s the author of different scientific papers and books, primarily about low-volatility investing. In his book ‘High returns from low risk: a remarkable stock market paradox’ he devised a strategy that provides above market returns by investing in low volatility stocks.

Low-volatility anomaly

The Capital Asset Pricing Model (CAPM) is widely used to predict the risk of investments. The model assumes that returns can be predicted by a lineair model that uses volatility of the asset compared to the market. While this model was widely adopted throughout the finance industry, different academics soon challenged the assumptions used as they were not supported by empirical evidence. One of the first to do this was professor Robert Haugen, who questioned the methodology used to produce the supporting empirical evidence. (link: click here) Different studies confirmed Mr Haugen’s findings, however as it was counterintuitive, the investment community still uses the CAPM to this day.

Pim’s conservative stock formula

Pim built his strategy around this low-volatility anomaly or investment paradox, but he added two other factors into the mix.

  1. First he added a value component as he wants to detect stocks that were temporarily ‘on sale’. Stocks that generate a higher income for their shareholders compared to the value of the company are preferred. Pim measures income as dividends and share buybacks.
  2. Secondly, he added a momentum factor as some stocks might be cheap for a reason. Some stocks are value traps and even if they’re relatively cheap, there might not be any catalyst for recovery. As momentum factor, Pim uses the 12-month price index.

To get the list of stocks, Pim runs through the following steps:

  1. Start from a universe of the largest 1.000 stocks available. (Pim uses only US stocks in his book)
  2. Take the 500 stocks with the lowest volatility. (Pim uses 3 year volatility. In our template we use 2 year volatility as volatility over a 3 year period is not available)
  3. Select the top 20% of these stocks based on the combined raking of shareholder yield and 12 month price index. Buy these stocks.
  4. Repeat the process quarterly and rebalance the portfolio.

This formula selects:

low-risk companies that ‘conservatively’ deploy their capital, as they would rather distribute money to their shareholders than spend it on corporate activities themselves. The formula is also ‘conservative’ with regards to the timing. These stocks are only included when their business momentum improves and other investors have started to bid up their prices.

The author backtested this model over the period 1929-2015 and found that this model generated a 15% return per year. Compared to a portfolio of high-volatility stocks, it also proved to be more stable during more difficult periods.

Click here to go to Pim van Vliet's website.

The conservative formula in Valuesignals

Pim was so kind to provide us with guidance and feedback on how to best build his screen. We took the following steps:

  • Set the minimum market Cap to $4,000m.
  • Select the top 50% stocks with lowest volatility
  • Create a custom factor based on shareholder yield and 1Y price index. Sort the results by this factor.

Other Screens


This screen was designed by the MFIE Capital team in 2010 and reveals companies with consistent earnings power for which the shares are trading at a considerable margin of safety. It can be seen as an extension of the Greenblatt Magic Formula as it uses the same calculation method and shares 2 ratios with the latter. The big difference is that it looks for companies that trade at a discount compared to book value and filters out companies that showed exceptional results during the last year. We made this screen available to all our users since it showed superior performance in our backtest.

“Our ERP5 screen generated a return of 18,66% annually in the period 1999-2010. By filtering out companies with an f-score less than 7, the return increased to 19,5% per annum.”

How does it work?

We rank companies based on 4 ratios:

  1. Earnings Yield (EY): EBIT/Enterprise Value. This compares the earnings of a company compared to its theoretical purchase price. (market capitalization + debt) A company with a high EY can be purchased at a relatively low price compared to the earnings it generated during the last 12 months.
  2. Return On Invested Capital (ROIC): EBIT / (Net Working Capital + Net Fixed Assets). A company with a high ROIC demonstrates that it's lean, i.e. it's able to generate high earnings compared to the money invested.
  3. 5 year ROIC: Average ROIC during the last 5 years. Has the company demonstrated that it's been able to generate relatively high returns in a consistent manner in the past.
  4. Price-to-Book: Market Cap/Common Shareholders Equity. How big is the margin of safety, i.e. the price you pay for a share compared to the book value of the company. Research shows that buying companies with a low price-to-book value generates superior returns. (e.g., Rosenberg, Reid-, and Lanstein 1984; Fama and French 1992; and Lakonishok, Shleifer, and Vishny 1994)

We rank each company on these 4 ratios and then sum up the rankings. We rank this score to get the ERP5 score.

We created a variation of this screen and named it the ERP5 Best Selection. This screen ranks the companies based on ERP5 score but also filters out ones with a f-score of less than 7. This way we only select companies for which the prospects are improving compared to last year. Adding this extra filter increased the yearly return in our 1999-2010 backtest by almost 1%, from 18,66% to 19,5%.