Magic Formula (Part I)

The Magic Formula is a Factor Model that ranks stocks by two factors:

  1. The value of a company relative to its earnings determines how "cheap" the market price of a stock is.
  2. The return on capital determins how "good" a company is.

Details of the strategy itself is not a secret, although measurements of certain parameters like Net Working Capital may differ depending on who you ask.

Get the Book: The Little Book that Beats the Market


One , Two , Three , Four , Five

What Is The Magic Formula?

By now, Joel Greenblatt has become a household name in the world of value investing. Greenblatt is the manager of Gotham Asset Management LLC, which he started in 1985 (as Gotham Capital) as a fund with a deep value philosophy. His book, The Little Book that Beats the Market, introduced to his audience a strategy for stock selection that focuses on companies that are both “cheap” and “good”. And while his book is certainly not big, it did give detailed instructions on how we can go about replicating his strategy, which in essence is a two factor long only model of stock selection.

"Cheap" and "Good"

Greenblatt defines "Cheap" as the value of a company relative to its earnings. Most often, we may see this represented as a ratio of the price of a security relative to its earnings (P/E). However, Greenblatt prefers to look at the ratio of pre-tax operating earnings as it relates to Enterprise Value (a measure of a company's equity value with its debt, excluding any cash it has on hand). This allows for companies with varying debt and tax structures to be more easily compared.

"Good" is represented by the Return on Capital of a company. This is described as the ratio of pre-tax operating earnings to the sum of a company's Net Working Capital and it's Net Fixed Assets. In other words, Greenblatt is quantifying the amount of tangible capital required to operate a business, and seeing how much money each dollar of deployed capital will yield back.

In this series, we will take a closer look at the theory behind the Magic Formula and try to backtest and replicate the strategy programmatically. We will refrain from espousing on the merits of his two factor system, and instead focus on the details of the calculations involved, with the aim to match the Magic Formula methodology as closely as possible. To get started, let's first go through the formula as it is explained in the book:

The Formula

  1. Establish a minimum market capitalization (usually greater than $50 million).
  2. Exclude utility and financial stocks.
  3. Exclude foreign companies (ADRs)
  4. Determine company’s earnings yield = EBIT/ EV
  5. Determine company’s return on capital = EBIT/ (Net Fixed Assets + Working Capital).
  6. Rank all companies above chosen market capitalization by highest earnings yield and highest return on capital (ranked as percentages)
  7. Invest in 20 to 30 highest ranked companies, accumulating 2 - 3 positions per month over a 12 month period
  8. Rebalance the portfolio once per year, selling losers one week before the year and winners one week after the year.
  9. Continue over a long term period (5 to 10+ years)

Strategy Replication

So does it work? We know that Greenblatt uses some of these same criteron in making decisions for Gotham's portolio. In Part II of this series, we look to replicate the strategy programmatically, to test it's performance against market index benchmark.