How to handle broken ratios in a stock screen
A financial ratio works only when its denominator answers the question the ratio claims to ask. If that denominator is zero, negative, or economically meaningless, the quotient isn't an extreme observation. The ratio has stopped working. A stock thesis should return null, attach a reason, and keep that result from earning points.
This matters most near the edge. Tiny positive equity can make return on equity look magnificent. Negative EBITDA can turn a heavily indebted company into a negative leverage ratio. Negative earnings can make a price-to-earnings multiple look low. Those outputs are mathematically valid division. They aren't valid measurements of quality, safety, or cheapness.
Why does a small denominator create a huge ratio?
A ratio is a comparison between a numerator and a base. Return on equity divides profit earned during a period by shareholders' equity on the balance sheet. Net debt to EBITDA divides a debt claim by a rough measure of operating earnings. A valuation yield divides an earnings or cash-flow measure by a market value.
When the base approaches zero, an ordinary numerator produces a large quotient. Suppose two otherwise different businesses report the same round amount of profit in an illustrative example. One carries a broad equity base and the other has almost no positive book equity left. The second reports far higher return on equity, even though the small denominator may come from accumulated losses or years of repurchases. The ratio praises the thin base without explaining why it is thin.
The sign can be worse. Divide positive profit by negative equity and return on equity becomes negative. That doesn't mean the operation earned a poor return on a usable equity base. There is no positive book-equity base to measure. Reverse the signs, with a loss over negative equity, and the quotient turns positive. A naive rule could award a quality point to a loss-making company because two negatives made a positive.
The same trap appears in leverage. Net debt divided by negative EBITDA produces a negative number. If your rule says lower leverage is better, that indebted, loss-making business can appear safer than a profitable company with little debt. The arithmetic followed instructions. The instructions failed to define where the ratio has meaning.
When is a ratio undefined for economic purposes?
Treat the denominator as part of the thesis. It isn't plumbing. Before dividing, write down what it represents and what must be true for the interpretation to hold.
Return on equity needs positive equity. Equity is the residual balance-sheet claim after liabilities. If it is zero or negative, net_income / equity can't tell you how productively a positive shareholder capital base was used. Our guide to taking return on equity apart shows how debt and a shrinking equity base can lift the ratio before that final break.
Net debt to EBITDA needs positive EBITDA. The ratio asks how large net debt is beside an operating earnings proxy. Zero or negative EBITDA doesn't imply wonderful debt capacity. It means this multiple can't describe the burden. The debt and cash amounts remain useful facts, and an interest-coverage test may add another view, but the leverage quotient should be null.
Earnings yield needs positive earnings if “cheap profitable business” is the claim. A negative numerator over positive enterprise value is a negative yield. That can be retained as a descriptive value, but it shouldn't enter a rank where a low multiple or high yield is supposed to mean cheapness among profitable firms. Gate positive operating earnings first. The distinction between a descriptive calculation and an eligible valuation signal is important.
Cash conversion needs the right sign in its base. Free cash flow divided by net income can ask whether reported profit arrived as cash. When net income is negative, the quotient changes character. Positive cash flow over a loss yields a negative ratio, while negative cash flow over a loss yields a positive one. Neither belongs on the same scale as cash backing for positive earnings. Keep the raw values visible and refuse the conversion score.
Zero isn't the only boundary. A technically positive denominator can be so small that the quotient is dominated by noise. That problem doesn't have one universal cutoff. A tiny equity base may be central to one special-situations thesis and disqualifying in a quality thesis. State the floor as a parameter and test nearby values. Don't smuggle a materiality judgment into an unexplained constant.
Why shouldn't you replace a broken ratio with zero?
Zero is an observation. Null means this feature couldn't answer the question. Collapsing them destroys information.
A company with zero net debt is meaningfully different from one whose leverage ratio can't be computed because EBITDA is negative. A company earning no return on a positive equity base differs from one with no positive equity base at all. If both receive zero, the result table can't tell business failure from measurement failure.
The distinction also changes composite scores. In a score gate, a zero-point ratio may be offset by points elsewhere. That can be reasonable for a measured weakness. It isn't reasonable when the thesis never measured the criterion. If return on equity is indispensable to the quality claim, put it under quality.required so a null produces a partial result that fails the gate. Strict gates and score gates covers that choice in full.
There are cases where zero points plus a flag is the right policy. Perhaps leverage is supporting evidence, and a company with negative EBITDA may still be worth examining under a turnaround thesis. Let that criterion award nothing, flag no_positive_ebitda, and allow the rest of the thesis to speak. The flag preserves why the point was absent. The gate decides whether absence is fatal.
Never patch the denominator with a tiny constant just to keep every row numeric. Adding a small amount changes the question and manufactures huge values around the boundary. Taking an absolute value is worse: it makes negative equity or negative EBITDA resemble a valid positive base. A winsorized ratio, which caps extreme observations, can stop one value from dominating a rank, but it can't repair a denominator whose sign invalidates the interpretation.
How should the thesis guard each ratio?
Use three layers. Guard the feature where it is calculated. Flag the failed interpretation where criteria are scored. Make required measurements explicit in the quality block.
The shape below is illustrative, and the bundled templates are the reference for exact fields. The Quantery thesis documentation covers the full DSL.
# Denominators have jobs: illustrative
quality:
required:
roe: no_valid_equity_base
fcf_yield: no_valid_market_value
params:
equity_floor: 0
ebitda_floor: 0
earnings_floor: 0
roe_strong: 0.20
roe_ok: 0.10
leverage_low: 1.0
leverage_max: 3.0
conversion_strong: 1.0
conversion_ok: 0.70
yield_strong: 0.06
yield_ok: 0.03
features:
ni_ttm: ttm(net_income)
fcf_ttm: ttm(free_cash_flow)
ebitda_ttm: ttm(ebitda)
equity_now: newest(total_equity)
debt_now: newest(total_debt)
cash_now: newest(cash)
roe: if(equity_now > $equity_floor,
ni_ttm / equity_now, null)
net_debt_ebitda: if(ebitda_ttm > $ebitda_floor,
(debt_now - cash_now) / ebitda_ttm, null)
cash_conversion: if(ni_ttm > $earnings_floor,
fcf_ttm / ni_ttm, null)
fcf_yield: if(market_cap > 0,
fcf_ttm / market_cap, null)
criteria:
profitability:
rules:
- { when: "is_null(roe)", score: 0, flag: no_valid_equity_base }
- { when: "roe >= $roe_strong", score: 2 }
- { when: "roe >= $roe_ok", score: 1 }
- { else: 0 }
leverage:
rules:
- { when: "is_null(net_debt_ebitda)", score: 0, flag: no_positive_ebitda }
- { when: "net_debt_ebitda <= $leverage_low", score: 2 }
- { when: "net_debt_ebitda <= $leverage_max", score: 1 }
- { else: 0 }
cash_backing:
rules:
- { when: "is_null(cash_conversion)", score: 0, flag: no_positive_earnings }
- { when: "cash_conversion >= $conversion_strong", score: 2 }
- { when: "cash_conversion >= $conversion_ok", score: 1 }
- { else: 0 }
valuation:
rules:
- { when: "is_null(fcf_yield) or fcf_ttm <= 0", score: 0, flag: no_positive_fcf_yield }
- { when: "fcf_yield >= $yield_strong", score: 2 }
- { when: "fcf_yield >= $yield_ok", score: 1 }
- { else: 0 }
The guards do different work. equity_now > $equity_floor establishes a valid base for the quality ratio. ebitda_ttm > $ebitda_floor prevents losses from masquerading as low leverage. ni_ttm > $earnings_floor keeps cash conversion on one interpretation. market_cap > 0 is a mechanical validity check for the yield denominator.
This draft makes ROE and FCF yield required, while leverage and cash backing can fail visibly without making the whole result partial. That's a thesis choice, not a universal hierarchy. If the claim is balance-sheet resilience, valid leverage probably belongs in quality.required. If the claim is a recovery among loss-makers, positive EBITDA can't be required because its absence defines the research set. You'd need a different leverage measure and a different claim.
How do you test whether the guard is doing real work?
First inspect exclusions before returns. Run the guarded thesis and group failed rows by flag. If no_valid_equity_base removes an unexpected part of the market, open several filings and check whether the field or your rule caused it. A null can come from missing data or an invalid economic base. Keep the reason visible.
Then save a second version with one guard changed. You might require equity above a small, declared materiality floor instead of using zero as the boundary. Keep every other feature, gate setting, test date, and benchmark fixed. Backtest figures are hypothetical and exclude costs. The question isn't which floor produces the prettiest curve. It is whether the thesis depends on companies crowded against the denominator boundary.
Check membership next. Which names disappear when the floor moves? Do they share a business explanation, such as aggressive repurchases, accumulated deficits, or a cyclical earnings trough? A guard that removes one coherent edge case is doing understandable work. A guard that removes unrelated companies because a vendor field is sparse is exposing a data-coverage problem.
Read the distribution around the cutoff. If most qualifying companies sit comfortably away from it, the result shouldn't care much about a modest nudge. If membership and performance flip when the denominator floor moves a little, your “quality” finding may be a thin-capital-base finding. Robustness testing one dial at a time is built for this diagnosis.
Finally, compare the guarded ratio with its raw components. A very high ROE should send you to net income and equity. A low leverage ratio should send you back to its raw inputs. A high cash-conversion ratio should send you to cash flow and profit. The quotient is a pointer. The filing lines explain it.
A broken ratio should fail loudly
Ratio guards aren't cleanup added after the thesis is written. They're part of the economic definition. Positive equity, positive EBITDA, and positive earnings each decide whether a familiar quotient is still answering its familiar question.
Write those conditions beside the calculation. Return null when the interpretation breaks. Keep the reason in a flag. Decide in advance whether that missing measurement rejects the company or only withholds points. Then move the boundary and see what changes.
A stock thesis gets safer when impressive nonsense can't score. Quantery leaves the feature formula, null policy, flags, and gate in your hands, so the refusal rule is yours too. Make it explicit enough that a strange result tells you where to look.
Research tooling, not investment advice. Nothing here is a recommendation to buy, sell, or hold any security. Screens, scores, and backtests are informational only; backtested results are hypothetical, exclude costs such as commissions and slippage, and do not guarantee future results. Verify against primary filings and make your own decisions.
Want to try this on your own rules? Quantery is free for 14 days: the full app, no card required.
← All articles