Kelly Criterion: The Mathematical Limit of Risk
The Logic of the Betting Limit: What is the Kelly Criterion?
Developed in 1956 by John L. Kelly at Bell Labs, the Kelly Criterion is a formula used to determine the optimal size of a series of bets. In algorithmic trading, it is the 'Golden Rule' of position sizing. It tells you exactly what percentage of your account to risk on every trade to achieve the maximum possible long-term growth of your capital.
Unlike a fixed 2% risk (which is a generic retail rule), the Kelly Criterion is dynamic. It adjusts your risk based on the specific Win Rate and Risk-Reward Ratio of your strategy. If your EA has a 70% win rate and a 1:1 reward ratio, the Kelly formula will tell you to risk a much larger percentage than an EA with a 30% win rate and a 1:5 reward ratio.
The Formula: (Win Rate - (Loss Rate / RR Ratio))
The most common version of the formula for traders is: Kelly % = W - [(1 - W) / R]. Where W is the win rate (e.g., 0.55 for 55%) and R is the risk-reward ratio (e.g., 2.0 for a $2 win vs $1 loss).
If the result is positive, the system has a 'Positive Expectancy' and is tradable. If the result is negative, the system will mathematically blow up the account over time, regardless of what lot sizing you use. The Kelly % is the 'Speed Limit' of your account growth. If you risk more than the Kelly %, your account's 'Compounded Growth' will actually decrease as you increase risk.
Kelly Criterion Execution Rules
Primary: Calculate the Win Rate (W) and Reward Ratio (R)
Formula: W - ((1 - W) / R) = Optimal Risk Fraction
Threshold: Always use 'Half-Kelly' or 'Fractional Kelly' for safety
Constraint: Never risk more than the Full-Kelly result
Market State: Account for slippage in your Reward Ratio calculation
Verified: Recalculate the Kelly % every 50-100 trades for accuracy
The 'Half-Kelly' Advantage: Avoiding the Blowout
The 'Full-Kelly' percentage is mathematically perfect but practically dangerous. In the real market, your Win Rate is never 100% stable, and slippage can occur. If the Kelly formula tells you to risk 10% of your account per trade, a small losing streak will result in a massive emotional and financial drawdown.
Professional quantitative developers almost always use 'Half-Kelly' (50% of the calculated result) or 'Fractional Kelly'. This significantly reduces the volatility of the equity curve while still capturing most of the compounded growth benefits. It creates a 'Safety Buffer' against the uncertainty of future market conditions.
MT4 Implementation: Coding the Kelly Filter
In MQL4/MQL5, an EA can calculate its own Kelly % based on its AccountHistory(). By scanning the last 100 closed trades, the EA can determine its current win rate and average win/loss ratio. It then automatically updates the AutoLot function using the Half-Kelly formula. This allows the bot to 'Self-Correct' its risk level as its performance fluctuates over different market regimes.