I started by setting up the main infrastructure for my stock screener by importing pandas and numpy for data handling, yfinance for market data, TA-Lib for technical indicators, and matplotlib/seaborn for visualization.
I used the 30 Dow Jones Industrial Average stocks and yfinance to download one year of daily OHLCV data (from January 1, 2025 to January 7, 2026), which I inspected to confirm data quality and structure before analysis.
I then built three custom scoring functions. The MA50 score combined three elements: the percentage distance of price from its 50-day moving average (50% weight), the recent slope of the MA50 over five periods (30%), and a long-term regime filter based on the 200-day moving average (20%). All components were normalized to a -1 to +1 range. The RSI momentum score measured changes in RSI, normalized by twice the rolling standard deviation, to capture strengthening or weakening momentum. The volume score combined current volume relative to the 20-day average with price direction to assess whether volume confirmed the price move.
With these metrics defined, I ran a full analysis across all 30 stocks, calculated each individual score, and averaged them into a composite final score. I stored all results in a pandas DataFrame for review.
To visualize the output, I created a horizontal bar chart ranking stocks from best to worst by final score. I also built a heatmap with a dynamically sized grid and a red-yellow-green color scale centered at zero, providing a quick visual snapshot of bullish and bearish signals.
I spot-checked Apple’s price data to validate the inputs, then finalized the workflow by sorting tickers alphabetically and rerunning the analysis to ensure consistent, reproducible results. This produced clean tables and visualizations ready for further analysis.
Overall, I built a systematic multi-indicator stock screener that integrates trend, momentum, and volume into a single quantitative signal for large-cap stocks.