Money management: playing the equity curve


This is an unusual post, because it is not about training any Neural Network (NN). It is not about training anything at all. It is not about a post on Artificial Intelligence. It is more about investment and position sizing. It is good news for some, because this post will be easily understandable by non-neural network people too.

To study position sizing, we omitted using NN, because NN introduces some kind of randomness into the study. We wanted to show some results without that stochastic nature, so we use the 2 bins Naive Learner in this post (introduced in the first post in this year). This agent has a lookback of 200 days, makes a statistics about what was the average ‘next day profit’ on Up and on Down days and it gives forecast for next day %gain based on this statistics. Note that this algorithm is adaptive, it has noticeable profit (29% CAGR) and most of all it is deterministic.

We usually don’t like using stop loss strategy, because in every short-term strategy, it induces loss in backtest.
We haven’t seen any backtest that showed a profit gain. Most of the time the advantage of stop loss level is as hedge to reduce the big drawdown.

Recently Jezz Liberty proved us that the stop loss method is very important. Playing random entry points (blind monkey entries), but using trailing-stop losses, he achieved 18% CAGR.
His main motto came from David Harding:

If you put in stops and run your profits and trade randomly you make money; and if you put in targets and no stops, and you trade randomly you lose money. So the old saw about cutting losses and running profits has some truth to it.

See the details here:
And here:

Stop loss is a kind of money management. There are other techniques to manage positions as well. The main point here is to avoid big losses. For example, another money management technique is playing the equity curve.
The basic idea is that we reduce the position to half or zero if we are under a MA (200 days MA) of the equity curve = portfolio value.

We insert another relevant quote from this site

We can see, that winning and loosing trades are going in series. This certainly can be used to improve out results in one of two ways.
First: we can use the profit curve to adjust the size of the lot. way we will use larger lots during winning periods, and smaller lots during times, when our system does not perform well.
Of course, this approach will not work, if we have series of loosing trades, with single winning trade between them, so it is necessary to do a careful study of the profit curve.

This approach is an example of money management strategy, and it can improve some trading systems dramatically.

For this we have to track the theoretical portfolio Value (TPV) separately from the Played Portfolio Value (PPV).
The MA should be calculated based on the original ‘theoretical’ PV. If not, imagine a situation that the Played PV dives under the MA(200). Now, it is under the MA(200), its position is reduced to half or zero. If the position is reduced to half, it will take a lot of time to gain enough profit to move above the MA(200), since all the positions, even the winning positions are reduced by half.

In the case that the position is reduced to zero, the strategy can never go above the MA(200), since it will stop accumulating profit or loss, it stays constant. After a while, the MA(200) will move down to this constant PPV, but this is not how we want to play this strategy.
We made a mistake in our first backtest implementation and didn’t notice that how important is that ‘playing the equity curve’ strategy should keep two versions of the PV: the TPV and the PPV.

We defined different money management types (MMType). This code illustrates the possibilities:

– MMType=5 is a virtual stopLoss strategy; exiting the position fully under MA
– MMType=6, is a semi-stopLoss strategy, having 50% in the position under MA
– some MMType methods can not only decrease the positions when we are in a loosing period, but can increase the position by 50% when we are in a winning period (above the MA).
– the MMType 5, 6, 7, 8 has another important parameter: the Moving Average Lookback period. That we varied as 1, 5, 50, 200, 1000.

The original naive learner gives the following equity curve: (leverage = 1 (always))

This chart shows the Portfolio Value, so the chart starts from $1.
We use red line to illustrate the MA(200) to have an intuitive feeling about those periods when the money management methods reduced the position.

The original naive learner gives the following equity curve when we boost it with leverage = 2. (with double, or Ultra ETFs, 2 times daily leverage can be played on a simple (even IRA) account; no margin account requirement is needed)

That is something that can make you a millionaire. Gives an amazing 60% CAGR, but the pain is significant: -78% DD. And that DD lasted for 7 years. That nobody can bear. Imagine that if you started the strategy exactly on the top in 2000. In 2007, you have -78% loss. That is a pity, because in 23 years this strategy gives $34,000 for every $1 invested. In another scale: you invest $1K, you got $34M in 23 years. You are more than a millionaire. But let’s forget this fact.
It is only a theoretical profit; in hindsight; with some parameter optimization (200days lookback), and as we said, there is no investor in this world who can bear the pain of -78% loss in 7 years and continues this strategy.

Let’s see when we have 50% reduced position under MA: (MMType=6)


Note how nicely the maximum loss, the DD is reduced by this technique. (Compared to the original, leverage = 1 case)

Let’s see when we have 50% reduced position under MA and 50% increased position above MA: (MMType=7)


Note that with about the same maxDD, the PPV increased significantly. (Compared to the original, leverage = 1 case)

And the whole performance measurements in tables: (PV, maxDD and CAGR charts)

Some notes:
-Between the MAs, the 50 days MA is the winner.

– Using the MA(50) and if we compare it to the original (leverage=1) version, we contend:
1. If we target the same PV=295 (as the original), but we want to decrease the maxDD, use MMType=6, MA(50): same PV, but maxDD went from -47% to -34%
2. if we target the same maxDD=-47% (as the original), but we want more profit, use MMType=7, MA(50): same maxDD, but PV went from 295 to 3,521 (10x times more)

Question: Does money management works?
Answer: Yes, it works;
the only problem is: it is difficult to define the ‘optimal’ parameter: which MA use? (for this task, for this period it was the 50 days MA, but for other tasks, other periods the magic number will differ)

Which MMType should we play?
Risk taker traders should prefer MMType=7 to ‘maximize’ gain; conservative investors should prefer MMType=6 to minimize the maximum loss (DD).


One Response to “Money management: playing the equity curve”

  1. 1 Zoe

    Hi, great post and lots of great insights. Thanks for sharing your thoughts. By the way here is another great site if you are interested in ETF Trend Trading…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: