the Kelly Ratio
a continuation of Part II
|
We're talking about betting a fixed percentage x% of our bankroll and winning n times
and losing m times after (n+m) bets.
- When we win, we win a certain fraction of our bet, namely
W1, W2, ... Wn.
- When we lose we lose a fraction of our bet,
namely L1, L2, ... Lm.
- If our bankroll is B and we win, our bankroll increases to B + x*B*Wk
hence our bankroll changes by a factor (1+x*Wk).
- If our bankroll is B and we lose, our bankroll decreases to B - x*B*Lj
hence our bankroll changes by a factor (1-x*Wj).
- After (n+m) trades (with n wins and m losses) our initial bankroll has changed by the factor:
G(x) = (1+x*W1)(1+x*W2)...(1+x*Wn)
(1-x*L1)(1-x*L2)...(1-x*Lm)
- Taking logarithms (to the base e) we get:
***
log[G(x)] = Σlog(1+x*Wk)
+ Σlog(1-x*Lj)
where Σ means "add them all up".
- Since log(1+z) = z - z2/2 + z3/3 - + ... when z is small
(and we can get log(1-z) by replacing z by -z), we expand and get:
log[G(x)] = Σ
(x*Wk - x2*Wk2/2 + - ...)
- Σ
(x*Lj + x2*Lj2/2 + + ...)
>Wait! log(1+z) = z - z2/2 etc. etc. What's that about?
We'll approximate log(1+z) by z - z2/2 which is pretty good when z is small ...
as we can see in Figure 1
>And is z small?
For us, z is one of those things like xWk and both x and Wk
are fractions less than "1", for example we might have x = 0.25 (meaning we bet 25% of
our bankroll) and Wk = 0.05 (meaning our WIN is 5% of our bet) in which case
z = x*W = (0.25)(0.05) = 0.0125 (meaning 1.25%)
so it's normally going to be pretty small so we can ...
>Okay! Okay! Please continue.
| Figure 1
|
- So far we have: log[G(x)] = Σ
(x*Wk - x2*Wk2/2 + - ...)
- Σ
(x*Lj + x2*Lj2/2 + + ...)
- Retaining just the first two terms, we get:
(1) log[G(x)] = xΣ
Wk - (x2/2)Σ
Wk2
- xΣ
Lj - (x2/2)Σ
Lj2
>Aha! I can see that the average of the wins & losses are going to
make their appearance
... AND the average of their squares! Isn't the average square related to the volatility?
Yes indeed! In fact,
(1/n)ΣWk2 -
{
(1/n)ΣWk
}2 = (Standard Deviation of the Wk)2
which we'll call S2(W).
See
SD stuff
Further, we'll let (1/n)ΣWk = W,
the Average of the Wk.
That mean we can use:
ΣWk2 = nS2(W)+nW2.
We can then rewrite Equation (1) as:
(2) log[G(x)] =
{nW - mL}x -
(x2/2){nS2(W)+nW2 +
mS2(L)+mL2}
Note that this has the form: G(x) = A x - (1/2)B x2 which describes a parabola and we might expect it
to have a maximum ... at x = A/B, as indicated in Figure 2A and ...
>Hold on! You replace log(1+z) by z - z2/2 and pick out a maximum, but log(1+z) doesn't HAVE a maximum!
Very good point! Let's look at log(G(x)) for an actual stock
(involving several hundred weekly returns).
Our original equation ***, above, can be rewritten:
log[G(x)] = Σlog(1+x*Rk)
where R is an actual weekly return, either a positive
Wk or a negative Lj.
Let's compare this to the approximation where we replace ln(1+z) by z - z2/2 and use the
average of the postive and negative weekly returns, W and L ... as in Equation (2).
We get Figure 2B.
>They're not the same!
Aaah, but the location of the maximum, that's pretty good, eh what?
|
Figure 2A
Figure 2B
|
Before we continue, note that if G is the Gain Factor over (n+m) trades, then the Gain Factor per trade
is G1/(n+m) and log[G1/(n+m)] = (1/(n+m)) log[G] ... so we'll divide both sides of Equation (2)
by (n+m) and put p = n/(n+m) and q = m/(n+m) and rewrite Equation ...
>So just give me the final answer, okay?
The maximum Gain Factor per trade occurs for:
best x = {
pW - qL}
/ {pS2(W)+pW2 +
qS2(L)+qL2}
where
W = average of the Winning returns
L = average of the Losing returns
S(W) = Standard deviation of the Winning returns
S(L) = Standard deviation of the Losing returns
p = probability of a win
q = 1 - p = probability of a loss
|
>So, is it any good?
Here's a few, where we trade every week (as explained in Part II) and we invest a percentage x% of our
bankroll and we compare the actual stock perforkmance (meaning x% = 100%, so we invest everything
with each trade) versus investing various Kelly-fractions as given in Part I, Part II and above:
Kelly #1: x = p - q/(W/L) = (p*W - q*L)/W
Kelly #2: x = (p*W - q*L)/(W*L)
Kelly #3: x = (p*W - q*L)
/ {p*S2(W)+p*W2 +
q*S2(L)+q*L2}
Note: Kelly #1 and Kelly #2 ignore the volatility and assume constant weekly returns equal to the average.
On the other hand, Kelly #3 uses the same average returns, but includes the volatility and ...
>Can you just give us the pictures?
>I like Kelly #2 best ... the green guy! It's always at the top of the curve, eh?
Uh ... you're looking at the right-hand curve.
But if you use the actual weekly stock prices, and invest using Kelly #3, you get a bigger final portfolio.
That's the blue guy, in the left-hand charts.
Note that it (usually) gives lower volatility.
Note, too, that Kelly #1 = Kelly #2 if L = 1 (meaning that you lose all of your investment when you lose).
>Like ... if you're betting on a horse race, eh?
Yes.
>So who uses Kelly #1?
How many guesses do I get?
To download a spreadsheet*, go to
Part II and RIGHT-click on the picture
of the spreadsheet and Save Target.
* The spreadsheet keeps changin' so don't expect it to look like the one shown in Part II
One other thingy:
There's another spreadsheet, explained like
this, which does Monte Carlo simulations.
To download a .ZIPd version, RIGHT-click
here and Save Target.
|