Kelly Criterion Formula

The mathematical formula for calculating optimal bet size to maximize long-term growth.

The Formula

f* = (p x b - q) / b
Where p = win rate, q = 1 - p, b = avg_win / avg_loss

Worked Example

Kelly Criterion Example

Win rate: 55%, Avg win: $200, Avg loss: $100
f* = (0.55 x 2 - 0.45) / 2 = 0.325 = 32.5%
Half-Kelly (recommended): 16.25%

Python Implementation

from gfil_calculators.position_size import calculate_kelly
result = calculate_kelly(0.55, 200, 100, 0.5)
print(f"Kelly: {{result['kelly_percent']}}%, Adjusted: {{result['adjusted_percent']}}%")

Try the Interactive Calculator

Free, no signup required

Open Calculator