← All posts

Does a Strong Balance Sheet Cushion Drawdowns? Leverage and Downside Risk in Python

Quintile and sector-neutral tests of net debt to EBITDA against maximum drawdown across three selloffs, using point-in-time S&P 500 membership to measure whether low leverage cushions declines.

What's the question?

"Quality" is supposed to protect on the downside. The claim that low-leverage firms fall less when markets fall is intuitive: a company with little debt has no lender to satisfy, no covenant to breach, and no refinancing to arrange at the worst moment. It is rarely tested.

Two terms define the test. Net debt to EBITDA measures balance-sheet leverage: total debt minus cash, divided by earnings before interest, tax, depreciation and amortisation — roughly how many years of operating earnings would repay borrowings. A negative value means more cash than debt. Maximum drawdown is the largest peak-to-trough decline over a window.

The practical question: does sorting on balance-sheet strength buy drawdown protection, or is it paying for a story?

The approach

Three selloffs: 2018 Q4 (20 Sep to 24 Dec 2018), COVID (19 Feb to 23 Mar 2020), and the 2022 bear market (3 Jan to 12 Oct 2022). One window is a single observation; three can disagree, and disagreement is informative.

  1. Build each universe point-in-time, via xfl.index("sp500", as_of=start). Using today’s membership to study a past drawdown is survivorship bias, especially damaging here: the firms later removed are disproportionately the ones that broke, and indebted firms break more often.
  2. Rank on leverage that was already public. Only fiscal quarters ending 120+ days before the window opens are used, clearing the 60-day annual and 40-day quarterly SEC filing deadlines. TTM EBITDA sums the last four.
  3. Measure max drawdown from return_daily, not raw closes, which step across splits and fabricate false drawdowns.
  4. Exclude Financials and Real Estate, where leverage is the business model rather than distress.
  5. Require positive TTM EBITDA, since the ratio is uninterpretable in sign when EBITDA is negative. Ranking rather than averaging stops extremes dragging bucket means.
  6. Sort into quintiles and test, with a Welch t-test on Q5 minus Q1 and a Spearman rank correlation.
  7. Repeat the correlation sector-neutral, ranking leverage and drawdown within GICS sector.

About 70 names per quintile. Drawdowns are negative, so a positive correlation means more leverage went with a shallower decline. One disclosure: statements are as currently restated, not as originally reported.

Code

import xfinlink as xfl
import pandas as pd
from scipy import stats

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

EPISODES = [("2018 Q4 selloff", "2018-09-20", "2018-12-24"),
            ("COVID crash",     "2020-02-19", "2020-03-23"),
            ("2022 bear market", "2022-01-03", "2022-10-12")]
EXCLUDE = {"Financials", "Real Estate"}

for name, start, end in EPISODES:
    cutoff = (pd.Timestamp(start) - pd.Timedelta(days=120)).strftime("%Y-%m-%d")
    universe = sorted(xfl.index("sp500", as_of=start)["ticker"].unique().tolist())

    f = xfl.fundamentals(universe, period_type="quarterly",
                         start=(pd.Timestamp(cutoff) - pd.Timedelta(days=500)).strftime("%Y-%m-%d"),
                         end=cutoff, fields=["ebitda", "total_debt", "cash_and_equivalents"])
    f["period_end"] = pd.to_datetime(f["period_end"])
    f = f.dropna(subset=["ebitda", "total_debt", "cash_and_equivalents"])

    lev = []
    for tk, g in f.sort_values(["ticker", "period_end"]).groupby("ticker"):
        g = g.drop_duplicates("period_end", keep="last").tail(4)
        if len(g) < 4:
            continue
        last, ttm = g.iloc[-1], g["ebitda"].sum()
        lev.append({"ticker": tk, "gics_sector": last["gics_sector"], "ttm_ebitda": ttm,
                    "net_debt_to_ebitda": (last["total_debt"] - last["cash_and_equivalents"]) / ttm})
    lev = pd.DataFrame(lev)
    lev = lev[~lev["gics_sector"].isin(EXCLUDE) & (lev["ttm_ebitda"] > 0)]

    p = xfl.prices(universe, start=start, end=end,
                   fields=["close", "return_daily"], max_rows=500000)
    assert p["ticker"].nunique() / len(universe) > 0.95, "panel truncated"

    dd = []
    for tk, g in p.sort_values(["ticker", "date"]).groupby("ticker"):
        r = g["return_daily"].dropna()
        cum = (1 + r).cumprod()
        dd.append({"ticker": tk, "max_dd": float((cum / cum.cummax() - 1).min())})

    m = lev.merge(pd.DataFrame(dd), on="ticker", how="inner")
    m["quintile"] = pd.qcut(m["net_debt_to_ebitda"], 5, labels=["Q1", "Q2", "Q3", "Q4", "Q5"])

    rho, rp = stats.spearmanr(m["net_debt_to_ebitda"], m["max_dd"])
    e = m[m.groupby("gics_sector")["ticker"].transform("size") >= 5].copy()
    e["lev_r"] = e.groupby("gics_sector")["net_debt_to_ebitda"].rank(pct=True)
    e["dd_r"] = e.groupby("gics_sector")["max_dd"].rank(pct=True)
    sn_rho, sn_p = stats.spearmanr(e["lev_r"], e["dd_r"])

    print(f"{name}: raw rho={rho:+.3f} (p={rp:.4f})  sector-neutral rho={sn_rho:+.3f} (p={sn_p:.4f})")

Full script with formatting and visualisation: balance-sheet-drawdown-protection-python.py

Output

Top panel: mean maximum drawdown by net debt to EBITDA quintile across the 2018 Q4 selloff, COVID crash and 2022 bear market. Bottom panel: raw versus sector-neutral correlation of leverage with drawdown for each episode.
============================================================================================
SAMPLE — point-in-time S&P 500 members, ex-Financials/Real Estate, TTM EBITDA > 0
============================================================================================
         episode                   window ranked_on_data_to  universe  ex_fin_re  ebitda_pos  final_n
 2018 Q4 selloff 2018-09-20 to 2018-12-24        2018-05-23       497        360         352      327
     COVID crash 2020-02-19 to 2020-03-23        2019-10-22       500        372         369      352
2022 bear market 2022-01-03 to 2022-10-12        2021-09-05       499        381         365      352

============================================================================================
MAX DRAWDOWN BY NET DEBT / EBITDA QUINTILE  (leverage known before the window opens)
============================================================================================

2018 Q4 selloff  (n=327)
   Q1 (least levered)   n= 66   median net debt/EBITDA  -0.36x   mean max drawdown  -25.91%
   Q2                   n= 65   median net debt/EBITDA   0.91x   mean max drawdown  -24.16%
   Q3                   n= 65   median net debt/EBITDA   1.69x   mean max drawdown  -23.13%
   Q4                   n= 65   median net debt/EBITDA   2.58x   mean max drawdown  -24.26%
   Q5 (most levered)    n= 66   median net debt/EBITDA   5.08x   mean max drawdown  -20.03%
   Q5 minus Q1: +5.89 pp   Welch t=+3.29  p=0.0013
   Spearman rho(leverage, max drawdown) = +0.187  p=0.0007

COVID crash  (n=352)
   Q1 (least levered)   n= 71   median net debt/EBITDA  -0.31x   mean max drawdown  -36.56%
   Q2                   n= 70   median net debt/EBITDA   0.95x   mean max drawdown  -40.11%
   Q3                   n= 70   median net debt/EBITDA   1.84x   mean max drawdown  -40.29%
   Q4                   n= 70   median net debt/EBITDA   2.71x   mean max drawdown  -43.20%
   Q5 (most levered)    n= 71   median net debt/EBITDA   4.89x   mean max drawdown  -44.84%
   Q5 minus Q1: -8.28 pp   Welch t=-3.55  p=0.0005
   Spearman rho(leverage, max drawdown) = -0.186  p=0.0005

2022 bear market  (n=352)
   Q1 (least levered)   n= 71   median net debt/EBITDA  -0.60x   mean max drawdown  -38.64%
   Q2                   n= 70   median net debt/EBITDA   0.71x   mean max drawdown  -33.12%
   Q3                   n= 70   median net debt/EBITDA   1.55x   mean max drawdown  -31.43%
   Q4                   n= 70   median net debt/EBITDA   2.58x   mean max drawdown  -30.04%
   Q5 (most levered)    n= 71   median net debt/EBITDA   5.41x   mean max drawdown  -30.24%
   Q5 minus Q1: +8.40 pp   Welch t=+4.33  p=0.0000
   Spearman rho(leverage, max drawdown) = +0.243  p=0.0000

============================================================================================
SECTOR MIX OF THE EXTREME QUINTILES
============================================================================================

2018 Q4 selloff
   Q1 (least levered)   Information Technology 19, Health Care 13, Consumer Discretionary 13
   Q5 (most levered)    Utilities 23, Consumer Discretionary 10, Industrials 9

COVID crash
   Q1 (least levered)   Information Technology 18, Health Care 16, Industrials 12
   Q5 (most levered)    Utilities 25, Consumer Discretionary 13, Consumer Staples 7

2022 bear market
   Q1 (least levered)   Information Technology 22, Consumer Discretionary 16, Industrials 12
   Q5 (most levered)    Utilities 25, Consumer Discretionary 12, Health Care 7

============================================================================================
SECTOR-NEUTRAL TEST — rank leverage and drawdown WITHIN sector, then correlate
============================================================================================
2018 Q4 selloff    n=327  raw rho=+0.187 (p=0.0007)   sector-neutral rho=+0.011 (p=0.8443)
COVID crash        n=352  raw rho=-0.186 (p=0.0005)   sector-neutral rho=-0.251 (p=0.0000)
2022 bear market   n=352  raw rho=+0.243 (p=0.0000)   sector-neutral rho=+0.112 (p=0.0359)

What this tells us

The sign flips across episodes, and every raw result is statistically significant.

In two of the three selloffs the most indebted firms fell less. In 2018 the least levered quintile lost 25.91% against 20.03% for the most levered — a 5.89 point spread favouring leverage, t=+3.29, p=0.0013. In 2022 the gap is wider: 38.64% against 30.24%, 8.40 points at p<0.0001. Either alone would suggest a strong balance sheet made drawdowns worse. COVID reverses it: 36.56% against 44.84%, leverage costing 8.28 points at p=0.0005.

The sector mix explains the contradiction. The most levered quintile is dominated by Utilities in all three episodes, 23 to 25 names out of roughly 70, while the least levered is led by Information Technology. A leverage quintile is largely a sector bet wearing a balance-sheet label.

The sector-neutral test confirms this. Ranking within sector, the 2018 effect collapses from +0.187 to +0.011 at p=0.8443 — indistinguishable from zero. The 2022 effect falls by more than half, from +0.243 to +0.112, surviving only marginally at p=0.0359. Both apparent "leverage protects" results were mostly sector composition: the 2022 rate shock repriced long-duration technology equity for reasons unrelated to balance sheets.

Only COVID strengthens under the control, from -0.186 to -0.251 at p<0.0001. That is the one episode striking the mechanism leverage operates through: a shutdown stops revenue while interest and principal remain contractually due. The extremes are real — in June 2021 Las Vegas Sands carried $26.9bn of net debt against $136m of trailing EBITDA, near 198x, casinos shut.

So what?

Balance-sheet strength is not a general-purpose drawdown hedge. It is insurance against one peril: a shock that interrupts cash flow. It paid in COVID and not in a rate-driven repricing, where duration mattered more than gearing.

Three consequences follow. First, sort leverage within sector, never across it: a raw leverage screen delivers a utilities overweight, and the manager should know whether that is intended. Second, size the expectation to the scenario — against a demand collapse, low leverage helps; against rising discount rates, it is close to irrelevant. Third, treat any single-episode quality backtest with suspicion. Each window here, alone, produces a significant result, and two of the three point the wrong way.

The discipline generalises: before attributing a cross-sectional result to the characteristic named in the sort, neutralise the obvious confounder and check whether it survives. Cash holdings face the same check in a cash-to-assets quintile sort across market declines.

Built with xfinlink — free financial data API for Python.