Hey there, it's your friendly neighborhood Old Man Dev. (That's my online persona, not my actual age – mostly.)

I spend my weekday evenings and weekends building AI agents and automated trading bots. Today, I want to share a massive backtesting pitfall I recently stumbled into. The TL;DR? A strategy that looked incredibly profitable turned out to be a mirage, all thanks to unadjusted data.

The Glitch in My "Cannibal Strategy" Backtest

I'd been developing a strategy to invest in companies that consistently reduce their outstanding shares – what I call "Cannibal" stocks. When a company buys back its own shares from the market, it tends to increase the value per share. It’s a pretty straightforward concept.

I ran a backtest using 10 years of historical data, and to my surprise, it showed exceptionally good performance. Honestly, I was pretty excited, thinking, "Hey, this might actually be a winner!"