The Kelly Criterion gives the position fraction that maximizes long-run logarithmic growth of capital given a known win rate and reward/risk ratio.
Formula
kelly_pct = W - (1 - W) / R
W = win rate (probability of winning)
R = average win / average lossWorked example: 55% win rate, 1.5 R/R.
kelly = 0.55 - (0.45 / 1.5)
= 0.55 - 0.30
= 0.25 -> 25% of capital per tradeShape
"position_sizing": {
"method": "kelly",
"estimated_win_rate": 0.55,
"estimated_rr_ratio": 1.5,
"max_position_pct": 25
}Params
- estimated win rate - expected win rate (0-1).
- estimated R/R ratio - expected average win / average loss.
- max position percent - hard cap on position size.
Adaptive estimates
The engine uses actual trade history (last 50 trades) to compute W and R when enough history exists. The estimates above are fallbacks for cold-start.
Why most traders don't run full Kelly
Kelly assumes the inputs are exactly right. Real-world estimates are noisy, and full Kelly under noisy inputs has very high drawdowns. See half_kelly and quarter_kelly for the safer variants.
Pitfalls
- Overestimating win rate kills you faster than underestimating. A 5pp overestimate at high R can produce ruin in a few bad trades.
- No volatility awareness. Kelly sizes the same regardless of current ATR; consider stacking volatility_adjusted if your stop varies in price terms.
