← All projects

Personal project · Quantitative research

Technology stock ranking

A Python research system that compares technology stocks to their closest peers, blends financial-statement valuation with price behavior, and tests whether the rankings survive realistic portfolio rules.

PythonpandasNumPyopenpyxlBacktesting

My contribution

I built the Python ranking workflow, repaired the fair-value and regime logic, added data-quality diagnostics, moved the project toward point-in-time historical testing, and created website-ready outputs. The current project includes the scoring pipeline, Excel workbook, website artifacts, portfolio simulator, older holdout check, construction experiments, and a no-broker forward paper-test tracker.

174Eligible ranked stocks in the saved website demo
$30MMinimum 20-day dollar-volume filter
Sept. 8, 2026Ranking model date for the saved output

Research summary dated September 11, 2026; main backtest and holdings exports refreshed September 12, 2026. The ranking, simulated holdings, and paper-test records have different observation dates; nothing on this page updates automatically.

Overview

Why this exists

The original idea was simple: technology stocks should not all be judged against the same market-wide yardstick. A semiconductor equipment company, a cybersecurity company, and an IT services company can all be in technology, but their margins, growth rates, valuation multiples, and price behavior are different enough that raw comparisons can be misleading.

This project turns that idea into a repeatable research pipeline. It groups stocks by subindustry, compares each stock with the peers it most resembles, calculates trend and valuation signals, adjusts for market regime, applies portfolio controls, and exports a ranked research view.

The project spans two model generations. The original model uses regime-dependent trend/value weights; the current saved ranking uses a fixed four-signal alpha blend.

Engineering challenges

Three changes made the research pipeline easier to inspect and test—not just better at producing a ranked list.

01 · Data quality

Make missing valuation inputs explainable

Problem: Missing peer assignments, share counts, and financial inputs could leave a stock without a usable fair-value score. A trend-only fallback could make an incomplete comparison look fully ranked.

Change: I repaired peer-bucket coverage, added a controlled share-count fallback with its source recorded, and exposed missing-input reasons in the workbook. In the original combined-score output, rows without fair value remain Unrated instead of silently becoming trend-only rankings.

Outcome: Readers can distinguish an unfavorable score from an unavailable one and inspect why a row could not be ranked. Sparse peer groups and incomplete inputs remain visible limitations.

02 · Regime logic

Use trading-day history, not script-run history

Problem: Sparse script-run snapshots were an unreliable basis for rolling regime windows. Separately, a neutral structural reading could suppress stronger stock-flow evidence.

Change: I rebuilt daily subindustry snapshots from price history and repaired the combination rule so strong stock-flow evidence can produce EarlyBull while structural breadth remains neutral.

Outcome: Rolling windows now reflect trading days, and improving groups can be distinguished from confirmed broad strength. The saved structural-only label still remained Neutral; this was a logic repair, not a reason to force a bullish label.

03 · Historical testing

Limit each historical test to information available then

Problem: Testing old dates with later financial disclosures or today’s stock list can give a model information it would not have had.

Change: I introduced filing-date cutoffs for historical fair-value scoring and historical membership windows for the stock universe, then added an older-period check and a no-broker forward paper-test tracker.

Outcome: The research can separate tuned-period results from additional validation. Historical-universe coverage is still incomplete, and the corrected older-period monthly top-10 test still trails both benchmarks—so this is progress toward stronger testing, not proof that all bias has been eliminated.

Inspect the data pipeline → · Read the results and testing limits →

Two model generations

Original combined score

Trend Weight × Price Trend Score + Benchmark Weight × Fair Value Score

Used to explain the early model and produce the workbook feature table. It is still useful because it exposes the raw trend/value logic and the regime weights.

Current alpha score

0.30 Value + 0.45 Peer Momentum + 0.15 Risk Momentum + 0.10 Downside Quality

Used by the saved website demo ranking. It keeps the peer-relative idea but adds confidence, risk, and subindustry-relative momentum learned from validation work.

Explore the original model → · Explore the current model →

GitHub / code

View source on GitHub ↗