DocsRisk ManagementKelly Criterion

Kelly Criterion

CriterionRisk Management

The Kelly Criterion node calculates the mathematically optimal fraction of your capital to allocate to a strategy, derived from its historical win rate and win/loss size ratio. It also exposes a fractional Kelly output that applies a conservative multiplier to prevent over-sizing, which is the practical choice for live trading.

Formula

W=wins / total trades (win rate)
L=1 − W (loss rate)
R=avgWin / avgLoss (win/loss ratio)
Kelly %=(W × R − L) / R
Fractional Kelly=Kelly % × kellyFraction

A positive Kelly % means the strategy has an edge. A negative value means the strategy destroys value and should not be traded at all.

Parameters

NameTypeDefaultDescription
kellyFractionnumber0.25Multiplier applied to the full Kelly % to produce a conservative fractional allocation. 0.25 = Quarter Kelly. Range 0–1.
Why Quarter Kelly? Full Kelly maximises geometric growth in theory, but it is highly sensitive to estimation error in win rate and win/loss ratio. In practice, traders use Half Kelly (0.5) or Quarter Kelly (0.25) to significantly reduce drawdown while capturing most of the long-run benefit.

Inputs & Outputs

PortTypeDescription
Input
input(number | null)[]Series of trade returns (positive = win, negative = loss). Windowed to the chart view range if set.
Outputs
valuenumber | nullFull Kelly % (0–1 scale). null if no valid returns or zero win/loss ratio.
fractionalKellynumber | nullvalue × kellyFraction. The recommended allocation fraction for live use.
winRatenumber | nullFraction of trades with positive returns (0–1).
avgWinnumber | nullAverage value of winning returns.
avgLossnumber | nullAverage absolute value of losing returns.
winLossRationumber | nullavgWin / avgLoss. Values above 1 mean wins are larger than losses on average.

Use Cases

Dynamic allocation from backtested returns

Connect a return series from a backtested strategy to Kelly. The fractionalKelly output tells you exactly what percentage of your equity to allocate, updating automatically as new trades are added to the window.

Strategy comparison

Run multiple strategies in parallel and compare their value (full Kelly %) outputs. A higher Kelly % indicates a superior edge; negative values indicate the strategy should be abandoned entirely.

Combining with Position Sizing

Use fractionalKelly × accountEquity as the equity input to Risk Per Trade, then pipe that into Position Sizing. This creates a fully Kelly-scaled position sizing pipeline.