BLOG

Behind the numbers.

Code examples, market analysis, and data quality deep-dives.

Do Healthcare Cash-Flow Margins Predict Returns? Signal Evaluation in Python
Which Dividend Stocks Survive a Cash-Flow Stress Test? Dividend Screening in Python
Does Heavy Insider Selling Predict Weak Returns? Insider Flow Test in Python
Can Quality Screens Reduce Small-Cap Balance-Sheet Risk? Russell 2000 Test in Python
Which Retailers Have Positive Operating Leverage? Margin Screening in Python
Is MSTR a Leveraged Bitcoin Proxy? Rolling Beta Analysis in Python
Is Micron's Memory Cycle Recovering? Inventory and Margin Forecasting in Python
Which Sectors Work When Bonds Rally? Rate-Sensitive Rotation in Python
Do One-Month Price Extremes Reverse? Signal Evaluation in Python
Do Low-Volatility S&P 500 Stocks Reduce Drawdowns? Factor Test in Python
Is AI Capex Paying Back Fast Enough? Revenue Hurdle Forecasting in Python
Could Shorter AI Asset Lives Hit Earnings? Depreciation Stress Test in Python
How Much AI Capex Risk Can a Portfolio Remove? Constrained Optimization in Python
Is the AI Capex Trade Crowded? Rolling Volatility and Sector Rotation in Python
Did the AI Boom Come From Existing S&P 500 Members? Point-in-Time Momentum Test in Python
Is AI Revenue Circular? Customer-Vendor Capex Loop Analysis in Python
Is the AI Trade Connected to Private Credit? Rolling Correlation Network in Python
Is Apollo More Balance-Sheet Sensitive Than Peers? Leverage Screen in Python
Are AI Earnings Supported by Cash Flow? Accrual and Capex Screen in Python
Can Defensive Stocks Hedge AI Drawdowns? Basket Regime Test in Python
How Fast Does the Market Price In Fed Decisions? FOMC Event Study in Python
How Much Are Options Sellers Overpaid? The Variance Risk Premium in Python
Which Companies Have the Worst Earnings Quality? Sloan Accrual Screen with Geographic Revenue Data in Python
Does the Oil-to-Gold Ratio Signal Recessions? XLE/GLD Backtest in Python
Is AI Spending Crowding Out Free Cash Flow? Capex Sustainability Across the Mag 7 in Python
Does a Long Energy / Short Bonds Portfolio Capture Inflation Surprises? Factor Construction in Python
Can a Hidden Markov Model Detect Oil Market Regimes? HMM Analysis in Python
Do Grain Prices Predict Food Inflation? Granger Causality Test in Python
Does the Corporate Credit Spread Predict Stock Market Crashes? BAA-AAA Spread Analysis in Python
Do Oil Stocks Hedge Inflation? Rolling Beta Analysis in Python
Which Stocks Are Most Rate-Sensitive? Equity Duration via Bond Beta in Python
Which Companies Have the Highest Accrual Ratios? Earnings Quality Screening in Python
Is Alpha Persistent or Decaying? Rolling Sharpe Ratio Analysis in Python
Are Markets Trending or Mean-Reverting? Hurst Exponent Analysis in Python
Is Consumer Discretionary vs Staples a Leading Indicator? XLY/XLP Ratio Analysis in Python
Does Heavy Capex Predict Future Stock Returns? Capital Expenditure Analysis in Python
How to Estimate Cost of Equity Using CAPM in Python
Is Volatility Predictable? Testing for Volatility Clustering in Python
Which Industrials Are Overleveraged? Net Debt to EBITDA Screening in Python
GM Before and After Bankruptcy: Why Entity Resolution Matters for Financial Data
What Is Adjusted Beta? Merrill Lynch Beta Shrinkage in Python
How Good Is a Stock Pick? Information Ratio and Tracking Error in Python
Do Stock Returns Follow a Normal Distribution? Testing for Fat Tails in Python
Which Large Caps Have the Highest Free Cash Flow Yield? FCF Screening in Python
Which Sectors Won Over 5 Years? Sector Rotation Analysis in Python
How to Forecast Stock Volatility with GARCH Models in Python
Are Stock Prices Mean-Reverting? Augmented Dickey-Fuller Test in Python
How to Calculate CAPM Alpha and Beta with Regression in Python
How to Compare Sector Sharpe Ratios and Sortino Ratios in Python
DELL: Why Stitching Historical Price Data Together Is Wrong
How to Analyze Drawdown and Recovery for Bank Stocks in Python
How to Screen SaaS Stocks by Revenue Growth and Cash Flow in Python
How to Screen REITs by Dividend Yield and Valuation in Python
How Correlated Are the Magnificent 7? Intra-Group Correlation in Python
AAPL vs XOM: Do Individual Stocks Have Seasonal Patterns?
How to Rank Large-Cap Stocks by Momentum in Python
How to Build a Multi-Endpoint Financial Dashboard in Python
How to Compare Volatility Across Energy Stocks in Python
How to Screen Healthcare Stocks by Valuation in Python
How to Build a Sector Correlation Matrix for Portfolio Diversification in Python
How to Find Oversold and Overbought Stocks Using Z-Scores in Python
How to Measure Earnings Quality: Cash Flow vs Net Income in Python
How to Build a Multi-Factor Stock Screen in Python (Value + Momentum + Quality)
How to Build a Simple DCF Model for Any Stock in Python
How to Screen Tech Stocks by Revenue Growth in Python
How to Screen Stocks by Balance Sheet Health in Python
Is "Sell in May" Real? SPY Monthly Seasonality Over 10 Years
How to Compare Sector Performance YTD Using Python
How to Track S&P 500 Additions and Removals Over Time in Python
How to Screen Dividend Stocks by Yield and Quality in Python
How to Calculate Max Drawdown and Recovery Time for Any Stock in Python
How to Compare Profitability Across Mega-Cap Tech Stocks in Python
Why Ticker Symbols Are Unreliable: The Recycling Problem Every Quant Should Know
How to Calculate and Compare Stock Volatility in Python
How to Screen Blue-Chip Stocks by P/E Ratio in Python
How to Track Companies Through Ticker Changes, Bankruptcies, and Renames in Python
S&P 500 Turnover: How Much the Index Has Changed Since 2010
How to Calculate Stock Beta and Correlation in Python
← All articles

Can Quality Screens Reduce Small-Cap Balance-Sheet Risk? Russell 2000 Test in Python

What's the question?

Small-cap investing often mixes two different exposures: size and financial fragility. A small company can be cheap because it is overlooked, or because it has weak profitability, thin cash generation, and too much debt. A quality screen attempts to separate those cases.

The question is whether a simple quality score can identify materially stronger balance-sheet profiles inside a point-in-time Russell 2000 sample. The goal is not to forecast returns. The goal is to reduce avoidable balance-sheet risk before doing deeper security analysis.

The approach

The analysis uses 300 Russell 2000 constituents as of December 31, 2025. Built from SEC EDGAR public filings and market data, it then pulls the latest annual metrics for those companies.

  1. Pull point-in-time Russell 2000 constituents with as_of="2025-12-31"
  2. Pull ROE, free-cash-flow margin, debt/assets, interest coverage, and market cap
  3. Remove records with missing data and extreme pre-revenue or distressed accounting values
  4. Winsorize the scoring inputs at the 5th and 95th percentiles
  5. Reward higher ROE, higher free-cash-flow margin, lower leverage, and higher interest coverage

The outlier controls are part of the method. Without them, a few extreme small-cap observations dominate the score.

Code

import xfinlink as xfl
import pandas as pd

xfl.set_api_key("YOUR_API_KEY")  # free at https://xfinlink.com/signup

members = xfl.index("russell2000", as_of="2025-12-31", limit=300)
tickers = members["ticker"].dropna().tolist()
fields = ["roe", "fcf_margin", "debt_to_assets", "interest_coverage", "market_cap"]

df = xfl.metrics(tickers, period_type="annual", period="3y", fields=fields)
latest = df.sort_values("period_end").groupby("ticker").tail(1).set_index("ticker")
screen = latest[fields].dropna()

screen = screen[
    screen["roe"].between(-1, 1)
    & screen["fcf_margin"].between(-1, 1)
    & screen["debt_to_assets"].between(0, 1.5)
]

print(screen[["roe", "fcf_margin", "debt_to_assets"]].describe())

Full script with formatting and visualisation: russell2000-quality-balance-sheet-python.py

Output

Russell 2000 quality screen showing free-cash-flow margin versus debt as share of assets
=== Russell 2000 Quality Balance-Sheet Screen ===
Membership date: 2025-12-31
Constituents requested: 300
Complete annual metric records: 176
Records after outlier controls: 129
Top quality quintile median ROE:   12.7%
Bottom quality quintile median ROE:  -14.1%
Top quality quintile median debt/assets:    5.0%
Bottom quality quintile median debt/assets:   40.1%

Top quality names:
TBBK   score=  7.17  ROE=  33.1%  FCF_margin=  36.6%  debt/assets=   2.3%  interest_cover=  298.1  market_cap=$2,393M
AII    score=  7.10  ROE=  29.6%  FCF_margin=  48.2%  debt/assets=   0.0%  interest_cover= 3385.0  market_cap=$330M
BANF   score=  5.94  ROE=  13.0%  FCF_margin=  34.3%  debt/assets=   0.1%  interest_cover=   75.0  market_cap=$3,828M
SRCE   score=  5.65  ROE=  12.4%  FCF_margin=  49.1%  debt/assets=   2.6%  interest_cover=   46.6  market_cap=$1,894M
APAM   score=  5.31  ROE=  66.2%  FCF_margin=  14.3%  debt/assets=  12.0%  interest_cover=   51.2  market_cap=$2,863M
AMTB   score=  5.13  ROE=   5.6%  FCF_margin=  29.4%  debt/assets=   0.0%  interest_cover= 5512.8  market_cap=$966M
AGYS   score=  5.01  ROE=  11.9%  FCF_margin=  21.3%  debt/assets=   0.0%  interest_cover=   87.3  market_cap=$2,585M
BWFG   score=  4.99  ROE=  11.7%  FCF_margin=  25.0%  debt/assets=   5.4%  interest_cover=  198.1  market_cap=$436M

Lowest quality names:
BKSY   score= -6.25  ROE= -74.1%  FCF_margin= -41.8%  debt/assets=  52.1%  interest_cover=   -3.1  market_cap=$1,292M
BHR    score= -4.80  ROE= -16.1%  FCF_margin=  -5.3%  debt/assets= 119.1%  interest_cover=    0.7  market_cap=$173M
BBAI   score= -4.72  ROE= -48.0%  FCF_margin= -33.3%  debt/assets=  12.0%  interest_cover=  -11.8  market_cap=$1,809M
ARDX   score= -4.70  ROE= -36.9%  FCF_margin= -10.8%  debt/assets=  40.4%  interest_cover=   -2.0  market_cap=$1,415M
TKNO   score= -4.42  ROE= -25.1%  FCF_margin= -24.2%  debt/assets=  12.9%  interest_cover=  -77.2  market_cap=$236M
ADPT   score= -4.40  ROE= -27.2%  FCF_margin= -17.7%  debt/assets=  24.7%  interest_cover=   -4.8  market_cap=$2,880M
BALY   score= -4.37  ROE= -65.4%  FCF_margin=  -7.3%  debt/assets=  39.7%  interest_cover=   -0.7  market_cap=$719M
BORR   score= -3.93  ROE=   8.3%  FCF_margin= -32.9%  debt/assets=  61.8%  interest_cover=    1.8  market_cap=$1,141M

What this tells us

The screen separates the balance-sheet profile clearly. The top quality quintile has median ROE of 12.7% and median debt/assets of 5.0%. The bottom quality quintile has median ROE of -14.1% and median debt/assets of 40.1%.

That difference is economically meaningful. The top group is not merely less leveraged. It is also more profitable and more cash generative. The bottom group contains companies with negative free-cash-flow margins, weak interest coverage, and high balance-sheet pressure.

The outlier controls matter. Small-cap universes include early-stage companies, distressed companies, and accounting edge cases. A quality process should identify those cases explicitly rather than letting them dominate the score.

So what?

A Russell 2000 allocation can carry more balance-sheet risk than the index label suggests. Screening for quality before valuation helps avoid companies where cheapness may reflect financial fragility.

The practical use is as a triage step. Start with point-in-time membership, remove incomplete and distorted records, then rank profitability, free cash flow, leverage, and interest coverage. The result is a cleaner research queue for small-cap portfolios.

Built with xfinlink — free financial data API for Python. pip install xfinlink

Built with xfinlink — free financial data API for Python. pip install xfinlink
← All articles