Risk Management · Position Sizing

Kelly Criterion + Position Sizing: A Complete Breakdown
Why almost everyone uses half-Kelly

2026-06-03·12 min read·Intermediate

In 1956, Bell Labs scientist J.L. Kelly Jr. published a paper titled "A New Interpretation of Information Rate" that tried to solve a gambling problem:when you have an informational edge, what fraction of your bankroll should you bet on each play to maximize long-term wealth?

The formula was later carried into financial markets by blackjack card-counting legend Edward Thorp, where it became the core of Princeton-Newport Partners (Wall Street's first quant fund). This article walks through the theory, why the industry uses "half-Kelly," Thorp's remarkable story, and how to implement it in Pine Script.

1. The Original Kelly Formula (Gambling Context)

Given:

  • p = win probability
  • b = odds (when you win, how many dollars you make per dollar bet)

Kelly fraction:

text
f* = p - (1 - p) / b

(where f* is "the fraction of your bankroll to bet," between 0 and 1)

A Concrete Example

Flip a biased coin: heads 60%, tails 40%. Correct guess wins $1, wrong guess loses $1. p=0.6, b=1.

text
f* = 0.6 - 0.4 / 1 = 0.2

→ Bet "20% of current bankroll" every time

Meaning: you start with $100, first bet is $20. Win and you have $120 → next bet is $24 (20% × 120). Lose and you have $80 → next bet is $16 (20% × 80). This rule maximizes the "long-run geometric average return."

Why Kelly Is Optimal
It's been proven mathematically: in a "repeated betting + compounding allowed" setting, the Kelly formula maximizes E[log(wealth)]. That is, the long-term growth rate of wealth is highest. This isn't "make the most money" (that's all-in) — it's "don't go broke + grow fastest in the long run."

2. Kelly Applied to Trading

Trading isn't as simple as "win $1 / lose $1." There's a trading version of the Kelly formula:

Discrete Version (For Strategies With Clean Entries and Exits)

text
f* = (p × b - q) / b

where:
  p = win rate
  q = 1 - p (loss rate)
  b = average win/loss ratio (average win / average loss)

A Concrete Example

Your strategy over the last 100 trades: 55% win rate, average win 2%, average loss 1%. p=0.55, q=0.45, b=2.

text
f* = (0.55 × 2 - 0.45) / 2 = 0.325

→ Risk "32.5% of total capital" on each trade
32.5% risk? Isn't that way too much?
Yes, and that's exactly Kelly's real-world "problem." Theoretical optimum = unbearable in practice. Picture three consecutive losses: 67.5% × 67.5% × 67.5% = 30.8% remaining. The account shrinks 70%.
Worse still: your estimates of p and b are never accurate. The smaller the sample, the larger the estimation error — and Kelly is hypersensitive to estimation error.

3. Why the Industry Uses "Half-Kelly" or "Quarter-Kelly"

This is industry consensus: in practice, bet 0.25 × f* to 0.5 × f*.

Three reasons:

Reason 1: Estimation Error

You don't actually know that p=55%, b=2. Those are estimates from the last 100 trades. The true p could be 50% or 60%, and the error band is wide. Kelly is highly sensitive to error — being off by 10% can push you to 50% risk. Using half-Kelly gives you a margin of safety.

Reason 2: Psychological Tolerance

Even though full Kelly is optimal in the long run, the path is brutal — max drawdown can exceed 50%. Most humans panic at a 30% drawdown and start violating their own system. Half-Kelly cuts the drawdown in half while only sacrificing about 25% of long-run return.

Reason 3: The Future ≠ The Past

A strategy's true edge decays as the market changes. This year p=55%, next year it might be 50%. Half-Kelly is essentially a pre-emptive hedge against edge decay.

The Math Across Kelly Multiples
(Assume f* = 0.2, theoretical annualized return 50%)
Full Kelly: 50% annualized, ~50% max drawdown, low ruin risk
Half-Kelly: 37.5% annualized, ~25% max drawdown, extremely low ruin risk
Quarter-Kelly: 19% annualized, ~12% max drawdown, essentially zero ruin risk
Bottom line: trade 50% safety for half-Kelly — the best risk-reward.

4. Edward Thorp — Kelly's Founding Father in Finance

Edward Thorp (born 1932) is an MIT math PhD who published Beat the Dealer in 1962 — using probability theory to crack blackjack card counting, making him the first person in casino history to win money systematically with math.

After making money counting cards in California casinos for a stretch (until casinos started banning him), he founded Princeton-Newport Partners in 1969, considered Wall Street's first quantitative hedge fund.

  • 1969–1988 (19 years): 19.1% average annualized return (after fees), with only 3 mildly negative months
  • Sharpe ratio of roughly 1.4 — steady for 19 years
  • Main strategies: convertible bond arbitrage + statistical arbitrage, all sized using Kelly
Thorp's Core Idea
"Don't be a hero. Use half-Kelly." Thorp always sized his own positions at half-Kelly, never full Kelly. His 2017 memoir A Man for All Markets documents this mindset in detail. The book also notes that he helped popularize Kelly thinking with Bill Gross, an early disciple.

5. Key Takeaways From William Poundstone's Fortune's Formula

Published in 2005, this book documents Kelly's journey from Bell Labs to Wall Street in detail. Highlights:

  • The Kelly formula is closely tied to Shannon's information theory (Kelly was Shannon's colleague)
  • Thorp used Kelly + card counting to beat the casinos
  • One core reason for Long-Term Capital Management (LTCM) blowing up in 1998: they used leverage well above Kelly
  • The long-running disagreement between academic Eugene Fama (efficient markets) and practitioner Thorp

6. Pine Script Implementation: Dynamic Kelly Sizing

The example below: (1) computes win rate / win-loss ratio over the last 100 trades, (2) computes the Kelly fraction, and (3) uses half-Kelly to size positions dynamically.

pine
//@version=5
strategy("Kelly Dynamic Position (Simplified)", overlay=true,
  initial_capital=10000, default_qty_type=strategy.percent_of_equity)

// === Your entry/exit signal (RSI used as example) ===
rsi = ta.rsi(close, 14)
longSignal = ta.crossover(rsi, 30)
exitSignal = ta.crossunder(rsi, 70)

// === Calculate strategy history (last 100 trades) ===
lookback = input.int(100, "Lookback Bars")
wins = ta.cum(strategy.netprofit > strategy.netprofit[1] ? 1 : 0)
losses = ta.cum(strategy.netprofit < strategy.netprofit[1] ? 1 : 0)
trades = wins + losses

p = trades > 0 ? wins / trades : 0.5
avgWin = ta.cum(strategy.netprofit > strategy.netprofit[1]
  ? (strategy.netprofit - strategy.netprofit[1]) : 0) / math.max(wins, 1)
avgLoss = ta.cum(strategy.netprofit < strategy.netprofit[1]
  ? math.abs(strategy.netprofit - strategy.netprofit[1]) : 0) / math.max(losses, 1)
b = avgLoss > 0 ? avgWin / avgLoss : 1.0

// === Kelly ratio + half Kelly ===
kelly = math.max((p * b - (1 - p)) / b, 0)
halfKelly = kelly * 0.5
positionPct = math.min(halfKelly * 100, 10)  // Max 10% position

if (longSignal and trades >= 30)  // Enough sample to use Kelly
    strategy.entry("Long", strategy.long, qty_percent=positionPct)

if (exitSignal)
    strategy.close("Long")

plotchar(positionPct, "Position %", "•", location=location.bottom)
Live Trading Notes
1. With fewer than 30 trades in your sample, don't use Kelly — estimation error is too large
2. Use half-Kelly, not full Kelly
3. Set an absolute cap (e.g., 10%) so Kelly can't run wild
4. During losing streaks, Kelly automatically shrinks — that's by design (it protects you)

7. When Kelly Doesn't Apply

❌ Sample Too Small

With fewer than 30 completed trades, estimates of p and b are too noisy. Kelly will spit out extreme numbers. Use a fixed percentage (e.g., 1–2%) until you've accumulated enough sample.

❌ Asymmetric Return Distribution

Some strategies are "small win, small win, small win + huge loss" (think selling OTM puts). In these "fat tail" cases, Kelly severely underestimates risk. You'd need an adjusted Kelly (accounting for higher moments), or simply not use it.

❌ Multiple Strategies Running Simultaneously

You have 3 strategies, each with a Kelly fraction of 10% — total 30%. But these strategies might be highly correlated (wrong in the same direction at the same time), so the real risk is well above 30%. Use portfolio Kelly instead.

❌ Constantly Re-tuning Parameters

Recomputing Kelly after every trade drags your size down on short-term drawdowns, causing you to miss the rebound. Better to re-estimate on a fixed cadence (monthly / quarterly).

Get started

Ready to ship what you just learned?

Once your strategy is written, TVSBot handles execution + risk control (daily max-loss kill-switch included).

Start free trial

8. The Practical Retail Version: Fixed Percentage + Occasional Kelly

For retail traders, don't apply Kelly directly. Recommended approach:

  1. Risk 1–2% per trade: the classic Turtle approach. Use ATR to compute the stop, work backward to find position size, so each trade's "max possible loss" is fixed at 1–2% of the account
  2. After 100 completed trades, compute the strategy's p and b, then use half-Kelly to sanity-check whether your current size is reasonable
  3. Cut size when strategy performance decays. If the win rate over the last 30 trades falls to 40%, cut position size in half immediately
  4. Kelly each strategy independently. Only low-correlation strategies can be summed — high-correlation ones need portfolio Kelly

9. Three Key Takeaways

  1. Kelly is "long-term optimal," not "short-term optimal."Short-term drawdowns can hit 50% — you have to be psychologically able to sit through it
  2. Trade 50% safety for half-Kelly. Industry consensus, and Thorp himself did the same
  3. Risk management matters more than the strategy itself. An average strategy + disciplined Kelly will beat a brilliant strategy + reckless sizing