Money Management II ... a continuation of Part I

In Part I we talked about "How much to put into each trade", so as to reduce your risk of large losses ... in case the stock heads South.

>I thought it was to increase your returns.
No, it's actually a kind of risk management, so we should really compare, say, the volatility and/or drawdown of a managed portfolio to one where large dollar amounts are involved with each trade..

>Drawdown?
Have you forgotten drawdown?
It's the maximum loss, calculated by looking at a running maximum of our portfolio value to see how large the drop to its current value, as in Figure 1.


Figure 1
We can get an idea of the reduction in drawdown by comparing that of a managed $50K portfolio (initially) and a buy-and-hold portfolio consisting (initially) of $50K stock.

See Figure 2? It compares the drawdowns and you can see that the managed portfolio, where we trade just 3% of our stock holdings, has a smaller average drawdown.

>Average? Average of what?
Didn't I mention that the spreadsheet does Monte Carlo?
You click a button and it does a hundred (or more ... or less) simulations.
Each simulation involves randomly selecting a bunch of returns.
It calculates the maximum drawdown for our portfolio and for the buy-and-hold stock portfolio
... then displays the averages.
Here's are a couple more comparisons at 2% and 5% trade size:


Figure 2

>So where's the spreadsheet?
It's the one I started with, in Part I.
I just keep adding to it. It now looks like this (where, as always, you click on the picture to download the spreadsheet):


Other Rituals

We've been talking about the magic formula:
Fixed Fractional Trading Scheme:
N = f*E / L
where
f is some fraction of your holdings (example: f = 0.02, meaning 2%)
E is the dollar amount of your holdings (example: E = $50,000)
L is the maximum loss per share (example: L = $10)
and N is the number of shares devoted to each trade (example: N = 0.02*50000/10 = 100 shares ... or contracts)

Another scheme championed by Ryan Jones is described like so:
Fixed Ratio Trading Scheme:
N = (1/2) [ 1 + (1+8P/delta)0.5 ]
where
P is the expected profit per trade (example: P = $1250)
delta is the per-contract profit required to increase you holdings by one contract (example: delta = $1000)
and N is the number of contracts devoted to each trade (example: N = (1/2)[ 1 + (1+8*1250/1000)0.5 ]) = 2.2

>Contract? What's a contract? And what's that delta guy? And where does that formula come from? And ...
Patience.

Of course, there's also what is perhaps the "original" scheme, the Kelly Ratio which suggests what fraction of your holdings you should bet on each trade:
Kelly Ratio Trading Scheme:
K = P - (1-P)/{W/L}
where
P is the probability of winning (example: P = 0.5, meaning 50% of the time you expect to win)
W is the expected dollar amount of your winnings per trade (example: W = $1.25)
L is the expected dollar amount of your losses per trade (example: L = $1.00)
and K is the fraction devoted to each trade (example: K = 0.5 - (1-0.5)/(1.25) = 0.1 or 10%.)

Note that it's the ratio W/L that's important. You get the same result with W=$12,500 and L = $10,000.

Of course, there's also ...

>Wait! You haven't explained that Fixed Ratio thing.
Okay, we'll assume that, at the Nth trade:
[1]     EN+1 = EN + N*delta
where En is the previous dollar value of your Equities and N is the number of contracts in the current trade.
Note: N increases by "1" with each trade. (It ain't fair to buy or sell a fractional contract, eh?)

Equation [1] assumes that you increase your Equity position by a fixed amount, namely $delta, with each contract.
We can then write (starting with the first trade where you buy N = 1 contracts):
E2 = E1 + delta
E3 = E2 +2 delta
E4 = E3 +3 delta
...
EN = EN-1 + (N-1) delta

Summing left and right sides, we get:
E2 + E3 + ... + EN = E1 + E2 + ... + EN-1 + [ 1+2+3+...+(N-1)] delta

Cancelling all the E's we end up with:
[2]     EN = E1 + (1/2)(N-1) N delta ... using a magic formula for summing 1+2+3...+(N-1)

What we want is N and that means we have to solve the quadratic equation:
[3]     N2 - N - 2(EN-E1)/delta = 0
To solve this we use ...

>Don't tell me! The world famous "Roots of a Quadratic" ... that's ... uh ...
It's:   N = (1/2) + (1/2)SQRT[ 1+8(EN-E1)/delta ]

Okay, now put our profit at:
[4]     P = EN-E1     we get     N = (1/2) [ 1 + (1+8P/delta)0.5 ]    ... as noted above.

>What happened to the other root of that equation, [3]?
It gives a negative number, so we ignore it.

>Are we finished yet??
Not quite. There's also:
Optimal f Trading Scheme:
Calculate the value of f that maximizes: W = (1 + f T1/L)(1 + f T2/L)...(1 + f Tn/L)
where
Tk is the trading profit or loss for the kth trade (example: T1 = $123, T2 = -$456, etc.)
L is the maximum loss per trade (example: L = $100)

If the "optimal" f is denoted by fopt (example: f = 0.30)
and your Equity is $E (example: E = $30,000)
N = fopt E / L   is the number of shares or contracts per trade. (example: N = (0.30)($30,000)/$100 = 90 contracts)

Note that E / L gives the number of "Maximum Losses" that'll wipe our your Equity.
Note, too, that L, the largest LOSS, is the largest negative value of T1, T2, ... Tn
.

>Huh?
If you lose $L with each trade and you've got $E in your portfolio, then E / L trades later ... you're dead.
>Yeah, I get that, but what's that optimal f thing?
Oh, that? It goes like this:
  • Suppose you make n trades and the n returns, as a percentage of your Equity, are: r1, r2 ... rn.
  • Then, after n trades, $1.00 will grow to W = $(1+r1)(1+r2)...(1+rn).
  • The profit or loss associated with your 1st trade is T1 = r1E1 where E1 is your Equity just before the trade ... with similar equations for subsequent trades.
  • Then the per-trade returns can be written as: rk = Tk / Ek   ... with k going from 1 to n.
  • The gain factor, after n trades, can now be written as: W = (1+T1 / E1) (1+T2 / E2)... (1+Tn / En)
    where your profits/losses per trade are T1, T2 ... Tn with some positive (that's profit) and some negative (that a loss).
  • Denote the largest loss by $L ... taken as a positive number. That is: L = - min [ T1, T2 ... Tn]
  • If we regard L as our "risk", then what fraction of our current Equity is that maximum loss? It's f = L / Ek.
    Okay, so we want to trade just that many shares (or contracts) on each trade so that: f = L / Ek is a constant.
    With this definition of f, we see that: Tk / Ek = f Tk / L
  • Then our n-trade gain factor becomes:   W = (1 + f T1/L)(1 + f T2/L)...(1 + f Tn/L)
    ... and that's what we want to maximize by clever choice of f.
>Yeah, but are you sure there is a maximum ... and how do you find it?
Uh ... if you insist that f lie between 0 and 1, then you will "usually" have a maximum as shown here:
In this example, the maximum loss (at Trade #12) is L = $63.39 and the gain factor that we're maximizing is:
W = ( 1+(65.13) f / (63.19) ) ( 1+(-41.33) f / (63.19) )( 1+(48.68) f / (63.19) ) ... ( 1+(-45.76) f / (63.19) )
Trade#
Profits/Losses
1
$65.13
2
-$41.33
3
$48.68
4
-$1.82
5
$38.02
6
$63.08
7
$16.13
8
$81.86
9
$15.34
10
$76.40
11
$56.37
12
-$63.39
13
-$33.11
14
$88.78
15
$69.42
16
$74.36
17
$37.04
18
$18.02
19
$2.76
20
-$45.76
>Usually? You will usually have a maximum?
Well, for that particular sequence of profits and losses. For another sequence, who knows?
For example, here's a sequence that doesn't provide a maximum for 0 < f < 1.

>Isn't there a maximum for f = 0?
Uh ... yes, that's true.

Trade#
Profits/Losses
1
-$31.95
2
-$47.01
3
$82.22
4
$42.50
5
-$77.74
6
-$90.85
7
$77.76
8
-$24.47
9
-$2.22
10
$78.95
11
-$45.42
12
-$61.17
13
-$98.55
14
$42.62
15
-$78.67
16
-$71.36
17
-$61.64
18
$37.08
19
$62.36
20
-$43.09

>Is there a spreadsheet, so I can play and get a feel for ...?
Yes, you can play with this one. Just click on the picture to download the spreadsheet.
You get 20 random profits/losses and a plot of W versus f so you can see when (if?) there's an f-value in 0 ≤ f ≤ 1 that provides a maximum.

>Can I stick in my own profits/losses in column B?
Be my guest.

>So if fopt turns out to be, say 60%, something like the picture above, then I risk 60% of my Equity, right?
Good heavens! NO!! That's just the preamble to "optimal f". Your trade should involve N = fopt E / L shares.
Note that N*L is what you'd lose if every trade lost the maximum amount: $L. That maximum total loss, as a fraction of your Equity, is fopt.
In the spreadsheet example, if your Equity was E = $25,000, then with fopt = 0.60, you'd trade N = (0.60)(25,000)/(85.64) = 175 shares (or contracts).

>Is it shares or contracts or what?
What's your favourite measurement of quantity? Bushels? Kilograms? 100-share contracts? Acres of stock?
Use whatever unit makes you happy.
>Fine, but you're talking about the past, right? I mean, them profits and losses are history?
Yes. You choose your favourite Buy-Sell strategy, use it on historical data to determine fopt and, assuming the future is a replica of the past ...
>What! Haven't you heard? You can't rely on the past to predict the future. I thought eveybody knew that!
Listen, this in not my technique.
It's a method described by Ralph Vince in the book "Portfolio Management Formulas : Mathematical Trading Methods for the Futures, Options, and Stock Markets".

>So what's best? Fixed Fractional or Fixed Ratio or Kelly or Optimal-f?
I have no idea, but one-of-these-days I'll generate a spreadsheet to compare, but in the meantime I've modified the spreadsheet mentioned in Part I that downloads stock info.
Now it calculates a bunch of Profits & Losses and an optimal f:


Kelly fiddled

I must admit that my favourite scheme is the Kelly ratio.

>So that's the one you use?
Absolutely not! I've told you before, I don't use any of this stuff. I just like Kelly 'cause it's pretty.

We can fiddle with the Kelly Ratio ... like so:

  • Look at historical increases and decreases in the stock price ... daily, weekly, monthly, whatever.
  • Calculate p, the fraction of times the price increased and 1-p, the fraction of times the price decreased. They are our probabilities.
  • Note the average increase (or Winnings) $W and the average Loss $L.
  • The expected daily increase per share (a la Kelly) is: p W - (1-p) L ... which could be weekly or monthly or whatever.
  • Assume that the average time between trades is T days ... or weeks, months, whatever.
  • We take as the increase per share at each trade: [ p W - (1-p) L ] T ... namely (daily increase per day)*(number of days between trades).
  • If your Equity at the nth trade is $En, then the expected increase per share for each share traded, as a fraction of En, is:   [ p W - (1-p) L ] T / En.
  • If, at the nth trade, you trade Sn shares, your return at the time of the nth trade is:   Rn = [ p W - (1-p) L ] T Sn/ En.
We conclude that:
After N trades, separated by T days   ... on average
and making $[p W - (1-p) L]T per share   ... on average
the per-trade return is Rn = [ p W - (1-p) L ] T Sn/ En   ... on average,   where En is your Equity just before each trade of Sn shares
so each dollar of your Portoflio, after a total of N trades, is worth:   P = (1+R1)(1+R2)... (1+RN)   ... on average.
>On average, on average, on average ...?
Yeah, that protects us against faulty predictions.  

Proceeding, we want to maximize P or, equivalently, we want to:
[5]     Maximize: log P = log(1+R1) + log(1+R2) + ... + log(1+RN)   ... by clever choice of Sn, the number of shares to trade, at each trade.

>Okay, you pick p and $W and $L and T, based upon historical precedent, so they're known. Then ... what?
Then you maximize P which depends upon the N variables Rn which depend upon the N variables Sn.

>And the variables E1, E2 ...
Well, your holdings go from En to En+1 as a result of the per-trade return Rn, so we might write:
[6]     En+1 = En (1+Rn) = En { 1 + [ p W - (1-p) L ] T Sn/ En } = En + [ p W - (1-p) L ] T Sn.

>That's confusing. I mean ...
Okay, let's start with an initial Equity of E = E1 and follow, step-by-step ... setting d = [ p W - (1-p) L ] T for sanitary reasons:

E2 = E + d S1
E3 = E2 + d S2
...
En = En-1 + d Sn-1
Summing each side and cancelling a bunch of stuff gives:     En = E+ d ( S1+S2+...+Sn-1).
Then the per-trade return, can be written:

[7]     Rn = [ p W - (1-p) L ] T Sn/ En = d Sn / En = d Sn / { E+ d ( S1+S2+...+Sn-1)}.
See? It doesn't depend upon the En, just the Sn.

>And E1.
Uh ... yes, that's your initial portfolio. I'll assume you know that.
Anyway, let's look at magic equation [7] ... dimensionally speaking:
(Return per Trade) = (Dollars per Share)*(Shares at the nth trade) / { Dollars + (Dollars per Share)*(Shares traded, in total)} = Dollars / Dollars.

>Huh?
It makes me feel warm all over to see that the Return is dimensionless:
It would be the same if currency were in Pounds or Yen
and time were measured in days or weeks or light-years
and shares were replaced by acres of stock ... or "contracts".

>So what's the maximum?
Patience.

We'll rewrite equation [5], using [7], like so:

[8]     Maximize: log P = Σ log(1 + Rn) = Σ log[ 1 + d Sn / { E+ d ( S1+S2+...+Sn-1)} ]   where the sum is from n = 1 to n = N.

>Uh ... what's that d again?
Okay, let's summarize:
Maximize, with respect to the N variables Sn:
log P = Σ log[ 1 + d Sn / { E+ d ( S1+S2+...+Sn-1)} ]   where the sum is from n = 1 to n = N
where
p is the probability of a daily gain (so 1-p is the probability of a loss)
$W = the average daily share gain, or Winnings
$L = the average daily share Loss
$[ p W - (1-p) L ] is the expected daily dollar gain
T = average number of days between trades
$d = [ p W - (1-p) L ] T is the expected dollar gain per trade, for each share
S1, S2, ... SN are the number of shares traded with each of the N trades
and the initial portolio is E = E1 ... just before the first trade.
>And P is the value of each $1.00 of your Portfolio after N trades, right?
Yes ... not to be confused with the probability p.
>Can't you use a different letter?
Pay attention.
log P can be written like so, to illustrate its format:
log P = log[ 1+d S1 / E ] + log[ d S2 / {E+ dS1} ] + log[1+d S3 / {E+ d(S1+S2)} ] + log[ d S4 / {E+ d(S1+S2+S3)}] + ...

>And you intend to maximize that, by clever choice of those Ss?
Uh ... maybe.

click to continue