Great investing books,
re-run as programs.
Every month, we take one rule from an investing classic, write it as a program, and publish the backtest. You get to see how the idea actually held up — not just how well it was argued.
Latest issue
The newest entry in the crate.
Peter Lynch on the peg ratio rule
One Up on Wall Street · 1989 · 18 min read
Lynch argued that a stock is cheap when its price-to-earnings ratio is below its growth rate. That single comparison became one of the most quoted rules in retail investing. We wrote it as a program and ran it over a decade of US large caps.
Rank every US stock by PEG = PE / growth, but only inside the fast-grower window: three-year earnings growth of 20–25% a year. Buy the cheapest end, equal weight, rebalance on the first trading day of each month. Six thresholds were run from no filter through PEG 0.5.
- Period: 2012 – 2024 (13 years)
- Universe: Top 3,000 US stocks by dollar volume
- Rebalance: Monthly, first trading day
- Positions: Equal weight, 6 to 100+ names by threshold
- Benchmark: S&P 500 at 14.5% a year
- Engine: QuantConnect LEAN, point-in-time data
Every issue, the same three steps
The format is fixed so issues stay comparable over time.
One book, one idea
Each issue isolates a single rule an author actually stated — not the whole book, not a vague philosophy. One rule, quoted and pinned down.
Turned into a program
The rule is translated into explicit code: universe, entry condition, position sizing, exit. Every assumption is written down so you can disagree with it.
Tested on real data
The program runs over a decade of market data across hundreds of names. Results are published as they came out, including the ones that did not work.
In the crate
Published so far, and what is being written next.
PEG did not beat the market. The six rules returned between +3.0% and +9.3% a year; the control that dropped the ratio entirely returned +9.7%, and the S&P 500 returned 14.5%. Ranking stocks by PEG carried no predictive information either — IC of -0.0086 and -0.0122 at t values of -0.59 and -0.60, nowhere near significant, with the faint tilt pointing the wrong way. It is a check on a name you already like, not a screen.
Graham gave the defensive investor seven hard filters and the enterprising investor a looser version. We test what survives modern markets and what was quietly killed by accounting changes.
Dalio divides the world into growth and inflation, each up or down, and holds a portfolio in every one of the four quadrants. The idea is simple to state and surprisingly hard to rebuild with public data.
One book, one program, every month
Join the list and get each new issue the day it is published.