Kelly CriterionPosition SizingRisk ManagementPython

The Kelly Criterion in Trading: Formula and Fractional Sizing

Published on September 12, 2026 · 10 min read
The Kelly Criterion in Trading: Formula and Fractional Sizing

The Kelly criterion is one of the most misunderstood formulas in quantitative finance. It is routinely presented online as a "secret sizing formula" for maximizing trading profits, when in reality it is a growth-rate optimization tool derived under strict statistical assumptions that real markets almost never satisfy. Understanding the mathematics — and, more importantly, understanding exactly where the mathematics breaks down — is a prerequisite for anyone doing quantitative position-sizing research.

Origins: an information-theory problem, not a trading strategy

The formula comes from John L. Kelly Jr.'s 1956 paper "A New Interpretation of Information Rate," published at Bell Labs. Kelly was not working on trading at all — he was solving a problem in information theory, showing how a gambler with privileged information transmitted over a noisy channel could optimize the fraction of a bankroll to wager to maximize the long-run exponential growth rate of that bankroll. The trading application came decades later, most famously through mathematician and hedge fund manager Ed Thorp, who first applied Kelly sizing to blackjack card counting and later to statistical arbitrage portfolios. It is Thorp's applied work, more than Kelly's original paper, that popularized the formula in finance.

Stacks of poker chips representing bet sizing under the Kelly criterion

Photo: dp singh Bhullar (Pexels)

Deriving the formula for a simple binary bet

Start with the simplest case: a bet with two outcomes, win or lose, repeated many times. Define:

  • p = probability of winning the bet
  • q = probability of losing the bet, where q = 1 - p
  • b = the net odds received on a win (a win pays b units for every 1 unit staked; a loss costs the full 1 unit staked)
  • f = the fraction of current capital wagered on each bet

After a sequence of wins and losses, capital grows multiplicatively. If you win a fraction of the time and lose the rest, your bankroll after n bets is proportional to:

(1 + f*b)^(wins) * (1 - f)^(losses)

Because this is a multiplicative (compounding) process, the quantity that matters for long-run growth is not the arithmetic average return but the expected value of the logarithm of the bankroll multiplier — this is what makes geometric, compounding growth different from a single-period expected-value calculation. Taking the expected log-growth per bet:

g(f) = p * log(1 + f*b) - q * log(1 - f)

Maximizing g(f) with respect to f — taking the derivative and setting it to zero — yields the Kelly formula:

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

Each term has a direct interpretation. b*p is the expected payoff per unit staked on a win, weighted by the win probability — essentially the "edge" side of the equation. q is the probability-weighted cost of losing. Dividing by b normalizes the edge by the odds being offered. When b*p > q, the bet has positive expected value and f* is positive; when the edge disappears, f* collapses to zero, correctly telling you not to bet at all.

Generalizing to continuous returns

Real trading positions do not resemble a simple win/lose bet with fixed odds — returns are continuous and asset-specific. The continuous-return generalization of Kelly, applied to a strategy or asset with a stream of returns, approximates the optimal leverage fraction as:

f* ≈ mu / sigma^2

where mu is the estimated mean edge (expected excess return per period) and sigma^2 is the variance of returns over the same period. This is the same underlying idea as the binary case: the numerator captures the size of the statistical edge, and the denominator penalizes uncertainty and dispersion in outcomes. Both formulas maximize the expected logarithm of terminal wealth, which is mathematically equivalent to maximizing the long-run compound growth rate of capital.

Expected log growth per bet by fraction wagered (p = 0.55, even odds)

-0.2 %0 %0.2 %0.4 %0.6 %0%4%8%12%16%20%Fraction of bankroll per bet
Exact computation of p·ln(1+f) + (1−p)·ln(1−f). Growth peaks at the Kelly fraction (10%) and turns negative near 20%.

Why "full Kelly" is a trap in practice

Full Kelly sizing is mathematically optimal for maximizing long-run geometric growth — but only under the assumption that p, b (or mu and sigma^2) are known exactly and that the underlying return process is stationary and independently, identically distributed (IID) across time. Neither assumption survives contact with real markets, for at least three compounding reasons.

First, parameter estimation error. Any real edge estimate comes from a finite historical sample. Estimation noise in mu and sigma^2 is not benign — it systematically inflates the apparent Kelly fraction, because a slightly overestimated edge or a slightly underestimated variance both push f* upward. Kelly sizing has no built-in mechanism to distinguish a real, persistent edge from a statistical artifact of a lucky backtest window, which is precisely the kind of failure mode discussed in more depth in our related piece on the data-snooping ratio and inflated Sharpe ratios.

Second, non-stationarity and regime shifts. The Kelly formula assumes the statistical process generating returns does not change. Financial markets undergo regime shifts — volatility regimes, correlation breakdowns, liquidity crises — that violate this assumption regularly. A Kelly fraction calibrated on a calm-market sample can be dramatically wrong the moment volatility spikes.

Third, and most severe, fat tails. Nassim Taleb has written extensively on why applying Kelly-style sizing to real-world return distributions is dangerous precisely because those distributions are not Gaussian — they exhibit fat tails, meaning extreme moves occur far more often than a normal distribution would predict. A sizing formula derived under an implicit assumption of well-behaved, bounded-variance outcomes is poorly equipped to handle a return distribution where a single tail event can wipe out a large fraction of capital. Because full Kelly sizing is aggressive by construction — it sizes up to the point where the growth-maximizing bet also carries very high variance — combining full Kelly leverage with fat-tailed, imperfectly estimated real-world edges is a well-documented recipe for catastrophic drawdowns, and in leveraged instruments, for outright ruin.

Fractional Kelly: exploiting a convex trade-off

The practical response used throughout applied quantitative finance is fractional Kelly — sizing at some fraction of the computed f*, most commonly Half-Kelly (0.5 * f*) or Quarter-Kelly (0.25 * f*). This is not a conservative afterthought; it exploits a genuinely favorable asymmetry in the shape of the growth-rate curve g(f).

The function g(f) is concave and reaches its peak exactly at f*. Near that peak, the curve is relatively flat — a well-known property of concave functions at their maximum — while variance and drawdown risk scale roughly linearly (and in some risk measures, worse than linearly) with position size. The consequence is a favorable convex trade-off: Half-Kelly sacrifices only a modest portion of the theoretical maximum long-run growth rate (in the idealized binary-bet case, roughly 25% of the peak growth rate is given up) while cutting the variance of outcomes and the magnitude of expected drawdowns by a much larger proportion, often close to half. Quarter-Kelly pushes this further in the same direction: even less growth given up in relative terms near the peak, and a substantially calmer equity curve. This asymmetry — small growth cost, large risk reduction — is the mathematical reason fractional Kelly is standard practice among practitioners who use Kelly-style sizing at all, rather than a purely psychological comfort measure.

Before deploying any sizing scheme derived from a backtested edge, it is worth stress-testing the underlying performance estimate itself for overfitting; TrueVerdikt's statistical backtest-audit tool at /outils checks for insufficient sample sizes, inflated Sharpe ratios from multiple testing, and other artifacts that would make a Kelly fraction computed from that backtest unreliable before it ever reaches a sizing decision.

Simulating the trade-off in Python

The script below computes the Kelly fraction from an estimated win rate and payoff ratio, then runs a vectorized Monte Carlo simulation comparing Full Kelly, Half-Kelly, and Quarter-Kelly sizing across many random simulated bet sequences, and compares the distributions of final equity and worst-case drawdown.

import numpy as np
import matplotlib.pyplot as plt

# --- Step 1: compute the Kelly fraction for a binary bet ---
def kelly_fraction(p, b):
    """
    p: probability of winning
    b: net odds received on a win (win pays b units per 1 unit staked)
    Returns f*, the Kelly-optimal fraction of capital to wager.
    """
    q = 1 - p
    f_star = (b * p - q) / b
    return max(f_star, 0.0)  # never bet a negative fraction

# Example: estimated edge from a hypothetical historical sample
p_est = 0.55   # estimated win probability
b_est = 1.0    # even-money payoff (1:1 odds)

f_full = kelly_fraction(p_est, b_est)
f_half = 0.5 * f_full
f_quarter = 0.25 * f_full

print(f"Full Kelly fraction:    {f_full:.4f}")
print(f"Half Kelly fraction:    {f_half:.4f}")
print(f"Quarter Kelly fraction: {f_quarter:.4f}")

# --- Step 2: vectorized Monte Carlo simulation ---
rng = np.random.default_rng(seed=42)

n_paths = 5000       # number of simulated capital paths
n_bets = 500         # number of sequential bets per path
starting_capital = 1.0

def simulate_paths(f, p, b, n_paths, n_bets, rng):
    """
    Simulates n_paths independent equity curves of n_bets sequential bets,
    each sized as fraction f of current capital, vectorized with numpy.
    Returns an array of shape (n_paths, n_bets + 1) of capital levels.
    """
    outcomes = rng.random((n_paths, n_bets)) < p  # True = win
    multipliers = np.where(outcomes, 1 + f * b, 1 - f)
    # cumulative product along the time axis gives the equity curve
    equity = np.empty((n_paths, n_bets + 1))
    equity[:, 0] = starting_capital
    equity[:, 1:] = starting_capital * np.cumprod(multipliers, axis=1)
    return equity

equity_full = simulate_paths(f_full, p_est, b_est, n_paths, n_bets, rng)
equity_half = simulate_paths(f_half, p_est, b_est, n_paths, n_bets, rng)
equity_quarter = simulate_paths(f_quarter, p_est, b_est, n_paths, n_bets, rng)

def max_drawdown(equity):
    """
    Computes the worst-case peak-to-trough drawdown for each path.
    equity: array of shape (n_paths, n_steps)
    Returns an array of shape (n_paths,) with the max drawdown per path.
    """
    running_max = np.maximum.accumulate(equity, axis=1)
    drawdowns = (equity - running_max) / running_max
    return drawdowns.min(axis=1)  # most negative value = worst drawdown

dd_full = max_drawdown(equity_full)
dd_half = max_drawdown(equity_half)
dd_quarter = max_drawdown(equity_quarter)

final_full = equity_full[:, -1]
final_half = equity_half[:, -1]
final_quarter = equity_quarter[:, -1]

# --- Step 3: compare distributions numerically ---
for name, final, dd in [
    ("Full Kelly", final_full, dd_full),
    ("Half Kelly", final_half, dd_half),
    ("Quarter Kelly", final_quarter, dd_quarter),
]:
    print(f"\n{name}:")
    print(f"  Median final capital:   {np.median(final):.2f}")
    print(f"  Std dev of final capital: {np.std(final):.2f}")
    print(f"  Median max drawdown:    {np.median(dd):.2%}")
    print(f"  Worst-case (5th pct) drawdown: {np.percentile(dd, 5):.2%}")

# --- Step 4: visualize ---
fig, axes = plt.subplots(1, 2, figsize=(12, 5))

axes[0].hist(final_full, bins=60, alpha=0.5, label="Full Kelly", log=True)
axes[0].hist(final_half, bins=60, alpha=0.5, label="Half Kelly", log=True)
axes[0].hist(final_quarter, bins=60, alpha=0.5, label="Quarter Kelly", log=True)
axes[0].set_title("Distribution of Final Capital (log scale)")
axes[0].set_xlabel("Final capital multiple")
axes[0].legend()

axes[1].hist(dd_full, bins=60, alpha=0.5, label="Full Kelly")
axes[1].hist(dd_half, bins=60, alpha=0.5, label="Half Kelly")
axes[1].hist(dd_quarter, bins=60, alpha=0.5, label="Quarter Kelly")
axes[1].set_title("Distribution of Worst-Case Drawdowns")
axes[1].set_xlabel("Max drawdown")
axes[1].legend()

plt.tight_layout()
plt.savefig("kelly_sizing_comparison.png", dpi=120)

Running this simulation with a modest, realistic 55% edge typically shows Full Kelly producing a wider, more right-skewed distribution of final outcomes alongside a heavier left tail of severe drawdowns, while Half-Kelly and Quarter-Kelly compress both tails substantially at a comparatively small cost to median growth — a concrete numerical illustration of the convexity argument above.

The methodological takeaway

The Kelly criterion is a rigorous answer to a narrow mathematical question: given known, stable statistics, what fraction of capital maximizes long-run geometric growth. It is not a validated trading strategy, and it says nothing about whether an estimated edge is real, whether it will persist, or how it behaves in the tails. Anyone using it as an input to real position-sizing decisions should treat the Kelly fraction as an upper bound to be aggressively discounted, not a target to be reached — and should scrutinize the backtest producing p and b at least as carefully as the sizing formula itself. TrueTrueVerdikt's ebook on risk management methodology covers this estimation-uncertainty problem in more depth, including how professional risk desks bound position sizes when the underlying edge estimate itself carries substantial uncertainty.

Disclaimer: This article is provided for educational and informational purposes only. It does not constitute financial, investment, or trading advice. Trading and investing involve substantial risk of loss. Past performance, backtested or live, is not indicative of future results. Always conduct your own research and consult a licensed financial advisor before making investment decisions.

From theory to practice

Measure and control a strategy's risk: drawdown, VaR, Sortino, Calmar and Omega ratios, position sizing and the Kelly criterion.

Analyse portfolio risk