The Kelly criterion in trading is a mathematical rule for choosing a capital fraction that maximises expected logarithmic growth under a specified outcome model. For fixed binary outcomes, the formula is f* = W − (1 − W) ÷ b, where W is win probability and b is the payoff ratio. The output depends on estimated inputs and model assumptions. It is not a recommended position size or a limit on drawdown.

J. L. Kelly Jr. introduced the growth criterion in A New Interpretation of Information Rate, published in the Bell System Technical Journal in 1956.[1] This page in the trading metrics library explains the binary formula, its calculator and the assumptions that fail when it is applied directly to trading.
Kelly criterion at a glance
Scroll horizontally to read every column.
| Item | Meaning |
|---|---|
| Formula | f* = W − (1 − W) ÷ b. |
| W | Probability of a winning outcome, entered as a decimal. |
| b | Win amount divided by loss amount, both positive. The binary model treats those amounts as fixed. |
| f* | Share of current equity lost on a full losing outcome in the model. |
| Objective | Expected logarithmic growth, rather than a maximum drawdown constraint. |
| Main limitation | Estimated probabilities, variable outcomes and concurrent positions can invalidate the simple fraction. |
What is the Kelly criterion formula?
Kelly fraction f* = W − (1 − W) ÷ b, where b = average win ÷ average loss
The average loss is a positive magnitude. The payoff ratio b is sometimes written as R in Kelly explanations. This library uses b to distinguish the payoff ratio from initial risk, R. A target distance divided by stop distance is a plan, not evidence of the realised payoff ratio.
The familiar formula is exact when every win returns the same b units for each unit risked and every loss removes that one unit. Substituting historical averages produces an estimate under that two-outcome approximation. Unequal winner and loser sizes can require the complete outcome distribution.
With fraction f at risk, a win multiplies equity by 1 + fb and a loss by 1 − f. For 0 < W < 1, b > 0 and 0 ≤ f < 1, the expected log-growth function is:
g(f) = W × ln(1 + fb) + (1 − W) × ln(1 − f)
Here ln is the natural logarithm. Differentiating gives g′(f) = Wb ÷ (1 + fb) − (1 − W) ÷ (1 − f). Setting that derivative to zero gives W − (1 − W) ÷ b. The second derivative is negative, so an interior solution maximises this model's objective.
A zero or negative result supplies no positive fraction under a constraint that f cannot be negative. It is not an instruction to reverse the trade. Reversing changes costs and the outcome distribution, which must be modelled separately.
Worked example: calculate an illustrative Kelly fraction
Illustrative inputs, not a recommendation or strategy results. Suppose independent outcomes have win probability W = 0.50, with each win paying 2R and each loss costing 1R. There are no breakevens, and the stated outcomes include all costs assumed by the model.
- Payoff ratio: b = 2 ÷ 1 = 2.
- Loss probability: 1 − W = 0.50.
- Kelly fraction: f* = 0.50 − 0.50 ÷ 2 = 0.25, or 25% of equity in this mathematical model.
- Model expectancy: (0.50 × 2) − (0.50 × 1) = +0.50R per trade.
Calculator
Kelly fraction calculator
f* = W - (1 - W) / b
W is the win probability and b is the payoff ratio after costs. This two-outcome model assumes independent trades, each winning bR or losing 1R. f* is the fraction of equity lost on a losing trade, not the notional position value. Variable outcomes need more than the average win and loss to determine a Kelly fraction.
Worked example with the default inputs.
- Kelly risk fraction f* (% of equity)
- 25.00%
- f* if W is 5 points lower (W floored at 0%)
- 17.50%
- Expectancy per trade (R)
- 0.50
Working 0.5 - (1 - 0.5) / 2 = 0.2500
Inputs are estimates. A small error in W or b moves f* sharply, as the second row shows. The result is the formula's output, not a suggested position size.
Illustrative calculator. Not a recommendation.
The 25% output is not a suggested trading fraction. The calculator applies the binary formula to estimated W and b. Its second row lowers W by five percentage points, leaving b fixed: 0.45 − 0.55 ÷ 2 = 0.175, or 17.5%.
The widget does not infer the probabilities from an account, model variable losses or account for simultaneous positions. Its numerical answer is conditional on the inputs. The expectancy calculation likewise describes a model average, not the next trade.
Why can full Kelly be too sensitive to use directly?
Full Kelly means the entire fraction calculated for the stated model. The growth objective assumes that the probabilities and outcome distribution are correctly specified and that capital can be repeatedly reinvested. Trading estimates do not arrive with that certainty.
| Illustrative W | Payoff b | Binary formula output |
|---|---|---|
| 50% | 2.0 | 25.0% |
| 45% | 2.0 | 17.5% |
| 50% | 1.5 | About 16.67% |
| 40% | 1.5 | 0% |
All four rows are sensitivity cases, not proposed allocations. A small change in estimated win probability or payoff changes the fraction substantially. Estimating both from the same selected backtest compounds the uncertainty. TradingView documents out-of-sample testing as a check on optimisation, while warning about overfitting.[2]
The objective also permits severe drawdowns. At the example's model fraction of 25%, five consecutive full losses leave (1 − 0.25)5 ≈ 23.73% of the starting equity, a 76.27% drawdown. Those are illustrative arithmetic outcomes, not forecasts.
A long-run growth objective cannot satisfy a separate capital floor or drawdown boundary merely by being mathematically optimal. The risk of ruin guide defines those boundary questions. Estimation error and drawdown exposure are reasons the formula should not be read as an execution setting.
What is fractional Kelly?
Fractional Kelly = c × f*, where 0 < c < 1
Fractional Kelly scales down the positive fraction produced by a Kelly model. “Half Kelly” means c = 0.5; it does not mean risking half the account. Under the example's f* = 25%, half Kelly is 12.5% and quarter Kelly is 6.25%. These values explain the labels, not an allocation recommendation.
A smaller c reduces the size of each modelled win and loss. Under a correctly specified model, moving below the interior Kelly optimum also reduces the expected log-growth objective. The trade-off is between that model objective and exposure to estimation error and drawdowns, not a promise of a particular outcome.
Multiplying a misspecified estimate by a fraction does not fix the misspecification. A missing tail loss or a wrongly measured payoff remains missing. No single fractional-Kelly multiplier is appropriate for every distribution, account constraint or investment horizon.
Why do average win and average loss sometimes give the wrong fraction?
The logarithm is nonlinear. The expected logarithm of varying outcomes is not generally the logarithm of their average. Two distributions can share W and b while having different Kelly solutions.
Illustrative distributions, not strategy results. Compare:
- Distribution A: a 50% chance of +2R and a 50% chance of −1R.
- Distribution B: a 25% chance of +1R, a 25% chance of +3R and a 50% chance of −1R.
Both have a 50% win probability, an average win of 2R and an average loss of 1R. The shortcut gives 25% for both. Distribution B instead has g(f) = 0.25 ln(1 + f) + 0.25 ln(1 + 3f) + 0.50 ln(1 − f).
Maximising that function gives f = (√33 − 3) ÷ 12 ≈ 22.87%. This is another mathematical comparison, not a suggested fraction. The difference comes entirely from the distribution of winners, before introducing gaps, variable losses or uncertainty in W.

How does Ralph Vince's optimal f relate to Kelly?
Ralph Vince's optimal f is a related approach that finds the fraction maximising the Terminal Wealth Relative, the compounded gain over a specified trade sample, with each trade scaled by the sample's biggest loss.[3] The binary Kelly shortcut instead starts with a two-outcome probability model. Both depend on the distribution supplied, but a sample optimum is not proof of a future optimum. A future loss larger than the historical reference loss also changes the sizing interpretation.
How does a Kelly fraction translate into a TradingView-to-MT5 workflow?
A fraction is a loss-budget concept in this model. It is not a lot size, a margin percentage or a stop distance. Converting a separately chosen budget to volume requires the account basis, the initial stop, the instrument's value per price unit and broker volume constraints.
As of 25 September 2026, PineConnector's syntax reference distinguishes cash, balance-based and equity-based planned loss budgets. Loss-based sizing requires one explicit stop method. The page warns that costs, fills, gaps and broker limits can change the actual loss.[4]
The same documentation defines sl_pct= as a stop distance set as a percentage of entry price, not a percentage of account risk.[4] A Kelly output cannot be pasted into an arbitrary percentage field with the expectation that its units will carry across.
The full route remains idea → measurable rule → TradingView alert → MT5 order. Keep the rule condition becoming true separate from the alert triggering, webhook delivery and PineConnector processing. The EA's order request, broker acceptance, deal and resulting position are further checkpoints.
PineConnector's setup test requires verification of the broker trade after the processing record.[5] A strategy-only stop is not a broker-side stop. The initial stop, accepted size and realised loss need their own records before the observed results can update an outcome model.
The single-opportunity formula also does not allocate among correlated open positions. Applying the same fraction independently to several positions can combine exposures that the isolated model never considered. A portfolio version needs their joint outcomes and constraints; averaging separate Kelly percentages does not supply that model.
Frequently asked questions
What is the Kelly criterion formula for trading?
The binary Kelly formula is f* = W − (1 − W) ÷ b, where W is win probability and b is the positive win-to-loss payoff ratio. The result is the share of equity lost on a full losing outcome in that model. Estimated inputs and variable trade outcomes limit its use as a trading calculation.
Is the Kelly fraction a recommended position size?
No. A Kelly fraction maximises a specified model's expected log-growth objective. It does not account automatically for estimation error, drawdown constraints, variable losses, concurrent exposure or broker limits. A fraction also needs a defined account basis and loss amount before it can be translated into volume. The calculator's output is not a sizing recommendation.
What is fractional Kelly?
Fractional Kelly multiplies a positive Kelly estimate by a factor between zero and one. Half Kelly uses half the calculated fraction, while quarter Kelly uses one quarter. Scaling reduces exposure in the assumed model but does not repair incorrect probabilities or missing loss outcomes. No universal multiplier resolves every account's constraints.
What does a negative Kelly fraction mean?
A negative binary Kelly result means the supplied win probability and payoff ratio do not support a positive fraction for the modelled opportunity under a nonnegative-stake constraint. It does not instruct the trader to reverse direction. A reversed trade has its own payoff distribution and costs, which the original calculation does not establish.
Is optimal f the same as Kelly?
Ralph Vince's optimal f and Kelly both concern growth-based sizing, but their stated inputs and loss normalisation can differ. Optimal f commonly searches a historical trade sample for the fraction maximising compounded terminal wealth. The simple Kelly calculator uses a binary probability model. Neither a historical optimum nor a model optimum establishes a suitable future allocation.
Reviewed 25 September 2026. Facts were checked against the linked sources on that date. Nothing in this article was tested on a trading account and no code was compiled.
Related reading
- Trading metrics: the complete library
- Payoff ratio and the average win/loss inputs
- Risk of ruin: boundaries, horizons and position size
- Position sizing methods and their units
- Sample size and uncertainty in trading estimates
Sources
- J. L. Kelly Jr. – A New Interpretation of Information Rate, Bell System Technical Journal (1956), PDF, accessed 25 September 2026.
- TradingView – Pine Script v6 User Manual: Strategies, accessed 25 September 2026.
- Andreas Hermes and Stanislaus Maier-Paape – Existence and Uniqueness for the Multivariate Discrete Terminal Wealth Relative (arXiv, 2017), accessed 25 September 2026.
- PineConnector – Syntax: Loss-Based Sizing and Stop Units, accessed 25 September 2026.
- PineConnector – Test Your Setup, accessed 25 September 2026.
PineConnector executes the instructions you send it. It does not select trades, manage money, or hold funds. Trading carries risk, and past performance of any strategy does not indicate future results.