1. What a stock screener is and why it saves you time
Level 4: Stock Screening
Filtering 500 companies by hand, checking one by one whether they meet a set of criteria, is simply not viable. A stock screener is exactly the tool that solves that problem: a filter that sweeps a universe of shares and returns only those that meet the conditions you define — a minimum market capitalization, a maximum price/earnings ratio, a sector, or any technical indicator.
There are ready-made free screeners, such as Finviz or TradingView, and they are a good starting point. But almost all of them cap real customization unless you pay for a subscription — and as soon as your filtering criterion combines several specific conditions (a particular moving average, a ratio computed your way, an indicator you defined yourself), the only way to have full control is to program it yourself.
The good news is that a home-made screener does not require much infrastructure: with the data you already know how to download (Level 3) and a few lines of pandas, you can build a working one in a Jupyter notebook. The rest of this level builds three real screeners, from the simplest to the most sophisticated, over the 500 companies of the S&P 500.
The first step, common to all three, is having clean data to start from — exactly the same download and cleaning process as in Level 3 (scraping tickers from Wikipedia, downloading with yfinance, dropna to remove gaps). From there, each screener adds its own filtering criterion on top of that same data.
To go deeper into this lesson
- Momentumin the glossary
- Momentum investing: what it is and its S&P 500 recordguide