Kelly criterion calculator
Find the bet size that maximises long-run growth, and see why most people bet a fraction of it.
How it works
The Kelly criterion picks the fraction of wealth to bet that maximises the expected logarithm of wealth, which is the same as maximising the long-run growth rate. Bet less and you grow more slowly; bet more and you grow more slowly too, and past twice Kelly the growth rate turns negative even though every bet has a positive edge.
Full Kelly is a very bumpy ride, and it assumes you know the true odds. Half Kelly gives up only a quarter of the growth while halving the volatility, which is why practitioners use fractions. The simulation shows the spread of outcomes for each choice.
Assumptions
- Bets are independent and the odds are known exactly.
- Binary mode: win b times the stake with probability p, otherwise lose the stake.
- Continuous mode: lognormal returns, continuous rebalancing and no leverage limit.
- The simulation uses a fixed seed, so it is repeatable.
Show the codePython, runs in the playground
import numpy as np
p, b = 0.55, 1.0 # win probability, net odds
f_star = p - (1 - p) / b
growth = lambda f: p * np.log(1 + f * b) + (1 - p) * np.log(1 - f)
print(f"Kelly fraction: {f_star:.6f}")
print(f"Growth per bet at Kelly: {growth(f_star):.9f}")
print(f"Growth per bet at half Kelly: {growth(f_star / 2):.9f}")
rng = np.random.default_rng(0)
wins = rng.random((10_000, 200)) < p
for f in (f_star, f_star / 2, 2 * f_star):
final = np.exp(np.where(wins, np.log(1 + f * b), np.log(1 - f)).sum(axis=1))
print(f"f={f:.3f}: median x{np.median(final):.2f}, P(lose money)={np.mean(final < 1):.1%}")
Questions
What is the Kelly criterion in one sentence?
Bet the fraction of your wealth that maximises the expected logarithm of wealth; for an even-money bet that is your edge, 2p - 1.
Why bet half Kelly?
Half Kelly keeps three quarters of the growth rate with half the volatility and much smaller drawdowns, and it protects you if you have overestimated your edge.
What happens if I bet more than Kelly?
Growth falls, and at twice Kelly it reaches zero. Beyond that you are expected to lose money over time despite having an edge.
How does it apply to investing?
For a continuously rebalanced position the Kelly leverage is the excess return divided by the variance. With 6% excess return and 20% volatility that is 1.5x, which most investors would consider far too aggressive given uncertainty in the inputs.
Educational use only, not investment advice. Results depend on the model's assumptions listed above and on your inputs. Calculations run in your browser and nothing you enter is sent to a server.