Building a Stock Screener I Can Actually Trust
After the first version of my trading platform, I rebuilt it around a hard rule: the tool is not allowed to flatter me. Every screener and backtester I’ve seen, paid or free, makes it easy to fool yourself. This build is organized around removing those opportunities one at a time.
The screener scans the S&P 500 on a volume-based strategy and hands candidates to a backtester. The strategy logic itself stays private, but the architecture doesn’t need to. Everything is config driven: date ranges, filters, presets for different market conditions. The finder and the backtester share a handoff, so a setup the screener flags can be tested immediately under the same rules it was found with, not a subtly different copy of them.
Trusting a backtest means being paranoid about fills. A backtest that assumes you got the daily close is lying to you about any fast-moving entry, so fills get verified against finer-resolution data. Every strategy result is benchmarked against plain buy-and-hold on the same ticker over the same window. And the feature I use most is what I call the loss autopsy: every losing trade gets pulled apart to show what the setup looked like at entry and what actually happened after. Winners teach you almost nothing. The losers are the curriculum.
Data comes through a provider abstraction, because data sources die. I’ve already had one library go unmaintained under me, and this time swapping providers is one module, not a rewrite. Charts mark every trade on the price history so I can click a result and see it in context instead of trusting a summary statistic.
Same rule as the garage: the fancy tool isn’t the one that tells you what you want to hear, it’s the one that shows you what’s actually there. A dyno that adds 50 horsepower to every pull would be popular, and useless.
