QTQuant Terminal
B2-01B2·intermediate·~19 min

Short selling, margin, and leverage

short-sellingmarginleverageshort-squeezerisk

▸ Pretest — guess, even if you don't know

You short 100 shares of a stock at $50, collecting $5,000 in sale proceeds. What is your maximum possible loss on this position?

Shorting, step by step

Selling something you don't own sounds like fraud; it's actually a regulated four-step loop:

  1. Borrow the shares. Your broker locates them — typically from another client's margin account or an institutional lender. Under Regulation SHO your broker must have reasonable grounds to believe shares can be borrowed (a "locate") before you short.
  2. Sell the borrowed shares at today's price. Cash proceeds land in your account (held as collateral — you can't spend them freely).
  3. Buy back ("cover") later, at whatever the market price is then.
  4. Return the shares to the lender.

Profit = sell price − buy-back price, minus costs. And the costs are real: you pay a borrow fee (an annualized rate on the position — well under 1% for easy-to-borrow large caps, but tens or even hundreds of percent annualized for hard-to-borrow names), and you owe the lender any dividends the stock pays while you're short. A short that's "right eventually" can still lose money to carry costs while it waits.

The asymmetry, and what it did in January 2021

Long: worst case −100%, best case unbounded. Short: best case +100% (stock to zero), worst case unbounded. You've swapped the good tail for the bad one.

This asymmetry creates a feedback loop called a short squeeze: when a heavily shorted stock rises, shorts face growing losses and growing margin requirements, forcing some to buy back — which pushes the price higher, squeezing the next short. The canonical case is GameStop, January 2021: reported short interest exceeded 100% of the float (shares had been borrowed, sold, and borrowed again), retail buyers piled in, and the stock ran from around 19atthestartofthemonthtoanintradaypeaknear19 at the start of the month to an intraday peak near 483 on January 28. Forced covering fed the rally. Melvin Capital, a hedge fund heavily short GME, lost over half its value that month and shut down the following year. The lesson for a quant is not "never short" — it's that short positions must be sized for the unbounded tail, and crowded shorts (high short interest, expensive borrow) carry squeeze risk that no backtest of calm periods will show you.

Margin accounts: trading with borrowed money

A margin account lets you post part of a position's value and borrow the rest from your broker (shorting requires one, since you're borrowing shares). Two numbers govern it:

Your equity is position value minus the loan. The loan doesn't shrink when the stock falls — your equity absorbs the entire move.

Worked example. Buy 100 shares at 100(100 (10,000) with 5,000cash+5,000 cash + 5,000 loan; maintenance margin 25%. At price PP, equity is 100P5000100P - 5000 and the ratio is (100P5000)/100P(100P - 5000)/100P. Setting that equal to 0.25 and solving: P=66.67P = 66.67. General formula for a long:

Pcall=Pentry1minitial1mmaintP_{\text{call}} = P_{\text{entry}} \cdot \frac{1 - m_{\text{initial}}}{1 - m_{\text{maint}}}

Check: 100×0.5/0.75=66.67100 \times 0.5 / 0.75 = 66.67. A 33% price drop puts you in a margin call: deposit more cash, or the broker liquidates — at whatever the price is, in whatever market conditions caused the fall. Note what happened on the way down: at 66.67yourequityis66.67 your equity is 1,667, down 67% on a 33% move. That's 2× leverage doing exactly what it says.

Leverage cuts both ways

Leverage multiplies exposure per dollar of your own capital. 2× leverage doubles every return — including the ones you didn't want. A −50% move on 2× leverage is −100%: a total wipeout, with no capital left to participate in any recovery. Losses are not symmetric with gains (A1's compounding lesson): after −100% there is no "waiting it out."

Leveraged daily-reset ETFs (2× and 3× products) add a subtler cost: they deliver 2× the daily return, and re-lever every day. In a choppy market that resetting compounds against you. Index goes +10% then −10%: the index ends at 1.1×0.9=0.991.1 \times 0.9 = 0.99 (−1%). The 2× daily ETF does +20% then −20%: 1.2×0.8=0.961.2 \times 0.8 = 0.96 (−4%) — worse than the −2% a fixed 2× buy-and-hold exposure would have produced. That extra loss is volatility drag, amplified by the square of the leverage. In a smooth trend these products can beat 2× buy-and-hold; in sideways chop they bleed. Holding them long-term is a bet on low volatility whether you meant it or not.

How quants actually think about leverage

Not as a return amplifier — as a risk-budget dial. A quant decides how much volatility (or drawdown) the portfolio should run, then sets leverage so the strategy's risk matches that budget: a low-vol strategy might be levered up to a 10% vol target, a hot one scaled down. Leverage never improves a strategy's Sharpe ratio — it scales numerator and denominator together — but it converts a good Sharpe into the return level you want, at the cost of fatter left tails, borrow costs, and margin-call risk in exactly the moments correlations spike. Sizing the dial is Track D's business; respecting it is this lesson's.

Try it

▮ EXERCISE · b2-01-ex1

Implement margin_call_price(entry_price, initial_margin, maintenance_margin) for a long stock position: the price below which equity / position value falls under the maintenance requirement. Formula: entry_price * (1 - initial_margin) / (1 - maintenance_margin).

⧉ Review card
What are the four steps of a short sale?
Borrow the shares (broker locates them), sell at market, buy back later (cover), return to the lender. You pay a borrow fee and owe any dividends paid while short.
⧉ Review card
Why is shorting riskier than buying, structurally?
Payoffs are asymmetric: max gain +100% (stock to zero), max loss unbounded (no ceiling on the buy-back price). Rising prices also raise margin requirements, which can force covering — the short-squeeze feedback loop.
⧉ Review card
At what price does a long bought at 100 with 50% initial and 25% maintenance margin get a margin call?
66.67. P_call = entry * (1 - initial) / (1 - maintenance) = 100 * 0.5 / 0.75. The loan stays fixed at 50/share, so equity hits 25% of position value after a 33% drop.
⧉ Review card
Why do 2x daily-reset ETFs lag 2x buy-and-hold in choppy markets?
They re-lever daily, so volatility drag is amplified. Index +10% then -10% ends at -1%; the 2x daily ETF does +20% then -20% and ends at -4%, vs -2% for a fixed 2x exposure.
⧉ Review card
How do quants use leverage?
As a risk-budget dial, not a return amplifier: scale a strategy's exposure so portfolio volatility hits a target. Leverage never improves Sharpe — it scales mean and vol together while fattening the left tail and adding margin-call risk.

Predict before the next lesson

◈ Calibration check

Could you explain a short squeeze and compute a margin call price without looking anything up?

1 = guessing · 5 = could teach it

⏻ End of lesson

Mark it read to book its 5 review cards into your deck.

Sources & further reading