The Backtest Library

Great investing books,
re-run as programs.

Every two weeks, 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.

1
Rule per issue
2 wk
Publishing cycle
10 yrs
Test window per idea

Next issue

Being written now. The full article lands with the results.

BL — 001

Peter Lynch on the peg ratio rule

One Up on Wall Street · 1989 · 9 min read

In the crate

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.

The rule, as written

Rank every stock by PEG = PE / (growth × 100). Buy the cheapest. Rebalance monthly. Sell on the same rule.

Setup
  • Period: 2015 – 2024
  • Universe: US large caps
  • Rebalance: Monthly
  • Positions: 20, equal weight

Every issue, the same three steps

The format is fixed so issues stay comparable over time.

Read

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.

Write

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.

Run

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.

One book, one program, every two weeks

Join the list and get each new issue the day it is published.