The Kelly Criterion was first formulated by John L. Kelly while working at the RAND corporation with Claude Shannon, the "father of IT" and the head of the Mathematics department at MIT at the time. Not long after Kelly wrote his paper (Kelly, J.L., 1956. "A new interpretation of information rate". Bell System Technical Journal 35, 917–926.), Edward O. Thorp started working at MIT as a new Ph.D. Mathematics graduate, and with access to a state-of-the-art IBM computer which he used to do help develop for his card-counting system for casino Blackjack, which he wrote about in "Beat the Dealer". After Shannon brought Kelly's paper to Thorp's attention, Thorp started using the Criterion to optimize bet sizes, then later position sizes in his stock market system for his hedge fund, which grew at a rate of about 20% per year for the many years it ran, only lost money in three months, to the amount of maybe 1-2% or less each time. I understand that's considered to be pretty successful.
Thorp derives the Kelly Criterion (http://www.eecs.harvard.edu/cs286r/courses/fall12/papers/Thorpe_KellyCriterion2007.pdf) for the case of a coin toss experiment of a biased coin for "even money", in which the win or losses at each trial are both equal to the size of the players's bet. I see "even money" as a special case since stock market gains and losses are rarely if ever for even money. To account for this, one can introduce additional variables "a" and "b" to scale the wins and losses of "f" to any fraction or multiple of "f", which I see as appropriate.
Thorp's starting model for even money is:
Xn = Xo * (1+f)^S * (1-f)^F where Xo and Xn are the initial and final bankrolls over n trials, f is the fraction of the player's current bankroll that is bet, and S and F are the number of successes and failures over n trials such that S + F = n. To normalize the bankroll size and the number of trials, the model can be modified to:
[Xn/Xo]^(1/n) = [(1+f)^(S/n) * (1-f)^(F/n)], at which point we can let G(f)=[Xn/Xo]^(1/n), p = S/n, and q = F/n, and write our model as:
G(f) = (1+f)^p * (1-f)^q
where G(f) is the geometric mean return per trial for each trial of the coin toss, p and q are the probabilities of winning and losing the toss, respectively, and f is the fraction of the player's bankroll that is bet at each trial.
We now want to find the value of "f" that maximizes G(f), the average geometric gain per trial. But since the values of p and q are between 0 and 1 and not integers, we must use the logarithm of our model, where g(f) = ln(G(f)), or:
g(f) = ln[(1+f)^p * (1-f)^q] = ln[(1+f)^p] + ln[(1-f)^q] = p*ln(1+f) + q*ln(1-f), so now we have the logarithmic function:
g(f)= p*ln(1+f) + q*ln(1-f)
We now want the value of f that will maximize g(f), (i.e., g(f*)), which we can find by taking its derivative g'(f):
g'(f) = [p*ln(1+f) + q*ln(1-f)] = [p*ln(1+f)]' + [q*ln(1-f)]' = p/(1+f) - q/(1-f), and we want f*, where g'(f*) is equal to zero:
g'(f) = p/(1+f) - q/(1-f) = 0
So: p/(1+f) = q/(1-f), or:
p*(1-f) = q*(1+f)
p - pf = q + qf
f*(p + q) = p - q, but since p+q=1, we have:
f* = p - q, which agrees with Thorp.
To generalize this form of the Kelly criterion to accommodate a win or loss of any size, we can return to our original model:
Xn = Xo * (1+f)^S * (1-f)^F and add "a" and "b", the fraction (or multiple) of f* that is lost (or returned, respectively), regardless of how much or little that might be, so:
Xn = Xo * (1+bf)^S * (1-af)^F, which brings us to:
G(f) = (1+bf)^p * (1-af)^q, then to:
g(f)= p*ln(1+bf) + q*ln(1-af)
g'(f) = bp/(1+bf) - aq/(1-af) = 0
So: bp/(1+bf) = aq/(1-af), or:
bp*(1-af) = aq*(1+bf)
bp - abpf = aq + abqf
bp - aq = abpf + abqf
abf * (p+q) = pb - qa, but since again, p+q = 1, we have:
f* = (pb - qa)/ab, or: f* = p/a - q/b
f* = p/a - q/b
Using this form of the Kelly Criterion, we can now optimize f* without confining ourselves to the special case where a or b must be equal to 1. When we study this equation closely, we can also see how it agrees with trading heuristics such as "cut your losses quickly" and "let your winners run". The process of cutting losses quickly is analogous to minimizing the value of "a", and the process of letting winners run is analogous to letting "b" get as big as it can. And while simply following the heuristics can keep a trader from "holding and hoping" when a trade goes the wrong way, and not leave regrettable sums of money on the table by pulling out too early when the market's showing no signs of stopping, the Kelly Criterion acts in a way that the more favorable "a" and "b" get, the bigger and bigger f* gets too, which is something the heuristics don't do. Not only does the Kelly Criterion actually reinforce some of the most closely followed trading heuristics in a rigorous, logical, scientific way, but it quantifies their importance in units of dollars.
All that is needed are the probabilities of gain and loss (p and q), and by how much in each case (b and a). Further refinements are necessary to optimize its performance, such as taking the time factor into account. The Kelly model was derived for a coin toss in which once the player's bet is placed, the rest is purely probabilistic, but in trading you should be able to scale in and out, which puts you back into the deterministic realm to an extent. Since with the more general form if Kelly's equation, the value of f* can get pretty large in theory, which the trader can use as a safety factor, or alternatively a means of optimizing leverage. The additional consideration with leverage though is that if you've levered your entire account and the trade goes the wrong way, you have to get out faster than the market can catch up to you, or that's all folks. To use leverage therefore requires a way to read the market enough to see something like that coming and to exit with enough control to avoid ruin and hopefully take your profits with you. To be able to do that would require mastering the Kelly method first without leverage, then finding a reliable way to measure liquidity and ensure you have enough to get you out fast whenever you want, and basically find ways to provide a healthy safety factor to keep from driving off a cliff. Finding ways to optimize all of the Kelly inputs a, b, p, and q and update them continuously throughout the trade - and reliably, will be the challenge when taking it as far as possible. But in the meantime, thanks for reading this!