The Claude Quant PlaybookDownload ebookDownload ebook

Kelly criterion

intermediateRisk and portfolio10 of 13

The Kelly criterion is the bet size that makes your bankroll grow fastest over many bets. Bet less and you grow slower; bet more and you grow slower too, and far enough past it you shrink.

Build a trading system with Claude.Download ebook

01The formula

the Kelly fraction: the share of your bankroll to stake on each bet
the probability of winning
the payout: you win b for each 1 you risk, and lose the stake otherwise
the expected log growth of the bankroll per bet when you stake a fraction f

02See it move

03Where it is used

04Why traders use it

Wealth compounds, so what matters over many bets is the average log return, not the average return. Kelly maximises that, and the curve shows how harsh over-betting is: twice Kelly gives roughly zero growth.

05Worked example

Winning 55% of the time at a payout of 1.0, Kelly says to stake 10.0% of your bankroll. That grows it by about 0.501% per bet on a log scale. Half Kelly still earns 0.375%, while double Kelly earns only −0.014%.

06How it is built

  1. After one bet of fraction the bankroll is multiplied by (win) or (loss).
  2. Over many bets the growth rate is the average log multiplier: .
  3. Set .
  4. Solve: . If this is zero or negative, you have no edge and should not bet.

07The common mistake

Plugging in an overestimated edge. If your real win rate is lower than you think, full Kelly is really over-betting, which is why most traders use half Kelly or less: it keeps about three quarters of the growth with far smaller swings.

08In Python and LaTeX

import numpy as np
p, b = 0.55, 1.0
f = p - (1 - p) / b
g = lambda f: p*np.log(1 + b*f) + (1 - p)*np.log(1 - f)
print(round(f, 4), round(g(f), 6), round(g(f/2), 6))
f^* = p - \frac{1 - p}{b}, \qquad g(f) = p\ln(1 + bf) + (1 - p)\ln(1 - f)

09Where it fits

Rather not code the maths yourself? Describe your trading idea and let AI build the bot.

Build a bot with AgenKit

The worked example and the model run the same code, so every number matches. Models simplify markets on purpose. This is education, not financial advice.