Trading Dev AcademyFree quant education

Free lesson · Risk

Kelly criterion: the fraction that maximises growth

Open interactive lessonPractice calculationsExplore labs

Start with the idea

Kelly maximises expected log wealth, so it penalises deep losses more heavily than arithmetic expectancy does. Its apparent precision depends on knowing probabilities and payoffs that a trader can only estimate.

Symbols, units & horizon
  • p: win probability
  • q=1−p: loss probability
  • b: net payoff per unit staked on a win
  • f: fraction of bankroll staked
  • g(f): expected log wealth growth per bet
  • f*: unconstrained optimum
  • ln: natural log
  • g′ and g″: first and second derivatives
  • Domain: 1+bf>0 and 1−f>0

When and why to use this

Use it as a sensitivity exercise for growth and overbetting. A practical risk policy also needs leverage, concentration, drawdown and liquidity limits.

Betting a fixed fraction f of equity on a repeated favourable bet, the long-run growth rate of wealth is the expected log return. Kelly is the f that maximises it. For a bet that wins b per unit risked with probability p:

g(f)=pln⁡(1+bf)+qln⁡(1−f),f∗=bp−qb
Differentiation + small-return approximation

Differentiate log growth and isolate the stake

  1. Wealth multiplies by 1+bf on a win and 1−f on a loss. Expected log growth is g=pln⁡(1+bf)+qln⁡(1−f), with q=1−p.
  2. Set the derivative to zero: pb(1+bf)−q(1−f)=0. Cross-multiply: pb(1−f)=q(1+bf).
  3. Expand and collect f: pb−q=bf(p+q)=bf, so f∗=(bp−q)b. The second derivative is negative in the feasible domain, confirming a maximum.
  4. For small continuous returns, expand ln⁡(1+fR)≈fR−f2R22. Maximising the expectation gives approximately f∗=μE[R2]≈μσ2 when the squared mean is negligible.
Work it by hand

p=.55, b=1 gives f*=.10. At half that fraction, exact g=.55 ln1.05+.45 ln.95≈.003752 per bet.

With p=0.55, b=1: f∗=(0.55−0.45)1=10% of equity per bet. Bet less and you grow slower; bet more and you also grow slower — and near twice Kelly the small-return quadratic approximation predicts zero growth. The exact break-even depends on the payoff distribution. Sufficiently excessive leverage can make expected log growth negative.

For continuous outcomes (returns rather than win/lose) the analogue is f∗≈μσ2 — the Sharpe ratio divided by volatility. Same message: size scales with edge and inversely with variance.

Strategy: 40% win rate, wins are 2.5× losses. Kelly fraction of equity per trade?

f∗=(2.5×0.4−0.6)2.5=(1.0−0.6)2.5=0.16. Half Kelly is 8%. Note that "risk 2% per trade" — the retail default — is roughly ⅛ Kelly here, which is conservative but not crazy given estimation error.

Why does betting more than Kelly reduce long-run growth even though each bet has positive expected value?

Growth compounds multiplicatively, so what matters is the expected log return, not the expected return. Log is concave: a −50% then +100% sequence has positive arithmetic mean and zero geometric growth. Larger fractions increase variance faster than they increase mean, and variance drags geometric growth by roughly σ22. Past Kelly the drag outruns the edge.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

from math import log1p

def log_growth(fraction, win_probability, net_win_multiple):
    p, b, f = win_probability, net_win_multiple, fraction
    if not 0 <= p <= 1 or b <= 0 or not -1/b < f < 1:
        raise ValueError("Invalid probability, payoff, or wealth-factor domain")
    return p*log1p(b*f)+(1-p)*log1p(-f)

def binary_kelly(p, b):
    if not 0 <= p <= 1 or b <= 0:
        raise ValueError("Require probability in [0,1] and b > 0")
    return (b*p-(1-p))/b  # before constraints or fractional Kelly

print(binary_kelly(.55, 1), log_growth(.1, .55, 1))

Continue learning

Risk Management — all lessons
  1. Start with gains, losses and an ordered sample
  2. Value at Risk and maximum drawdown: two views of the bad days
  3. Sharpe ratio: return per unit of risk
  4. Kelly criterion: the fraction that maximises growth
  5. Monte Carlo: your backtest is one draw from a distribution
  6. Expected shortfall and scenario risk

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations