Implementing the Kelly Criterion for position sizing
This medium-difficulty Python coding problem tests whether you can translate a fundamental risk-management formula into clean, correct code. Quant traders and prop shops use Kelly sizing to balance growth and ruin avoidance; getting the implementation right—including edge cases—is a basic professional skill.
The core task is straightforward arithmetic, but the problem rewards attention to two details: the handling of negative results (where the mathematical formula suggests not betting at all) and correct rounding. Both matter in live trading, where a sloppy implementation can either leave money on the table or risk more than intended.
- Formula translation and parameter interpretation
- Conditional logic for boundary cases
- Floating-point rounding and precision