Kelly Formula

Construction
PercentW = winning percentage W = average size of winning trade L = average size of losing trade

OptimumRiskPercent = PercentW - [ (1-PercentW) / (W/L) ]

Example
Say we win 60% of the time, PercentW = 0.6. The win is W = 8 and the loss is L = 4.

Then OptimumRiskPercent = 0.6 - [0.4 / 8/4] = 0.6 - 0.2 = 0.4

Therefore the percentage of equity that would provide max rate of return is 40%.

Example
PercentW = 0.1 W = 6 L = 4

Then OptimumRiskPercent = 0.1 - [0.9 / 6/4] = 0.1 - [0.9/1.5] = -0.5

Therefore we would always lose using this system.