Use the Kelly formula to calculate the optimal investment position, balancing long-term growth and risk control.
Core Formula
Full Kelly: f* = (bp - q) / b
b= payoff ratio (average profit/average loss)p= win rate,q= loss rate (1-p)f*= optimal position ratio
Simplified Kelly: f = μ / σ² (based on expected return μ and variance σ²)
Practical Recommendations
- Fractional Kelly: Use 1/4 or 1/2 Kelly to reduce volatility
- Position cap: single stock ≤25% (Munger principle)
- Minimum position: do not open a position when Kelly<2%
- Portfolio management: with multiple stocks, total positions need to be normalized
How to Use
When the user provides the win rate and payoff ratio, calculate full Kelly and apply 1/4 fractional:
let kelly = (b * p - (1.0 - p)) / b;
let safe_kelly = (kelly * 0.25).min(0.25).max(0.0);
Output Content
- Kelly optimal position
- Recommended position (1/4 or 1/2 Kelly)
- Risk level assessment
- Position limit explanation
- Rationale for the recommendation
Tools and Detailed Documentation
- 📁 Detailed calculation method
- 📁 Rust implementation reference
- 🔧 kelly_calculator.py - command-line tool