November 9, 2017

My last article: Trading a Buy & Hold Strategy. A Game You Can Play might have had a better subtitle than A Game You Can Win. It was demonstrated that a well-planned long-term stock trading strategy can be designed to survive and thrive for years and years. I had my preferred strategy (DEVX8) do its third walk forward, this time for almost a year. See the above-cited article for details.

If DEVX8 had not been able to continue and maintain close to its previous CAGR level, then it would also have fallen into the category of trading strategies that eventually fail simply by giving it more time to do so.

DEVX8 is designed to be sustainable, maintainable, marketable, and malleable over extended periods of time as its portfolio size grows. It is very similar to many trading systems out there, and yet quite different, unique in some ways.

It should not be viewed as a short-term trading strategy, even though short-term trades are made all the time. It is more of a long-term trend-following system, more akin to a Buy & Hold strategy. Its primary objective is to accumulate shares, hence its heavy bent on holding on to its shares for extended periods of time, if need be. And there resides its main difference, in, if need be.

DEVX8 has this simple mission: accumulate shares for the long term and trade over the process. That is all it does. It trades over its core positions. It is not a new concept. You buy shares as prices are rising and stand ready to wait for their appreciation. That is, it's the Buy & Hold side of things.

However, you add this variant. If prices go up enough, you accept to cash in some of the profits. The objective is to reinvest those profits in the same stocks later on by rebuying the same shares at a lower price or by buying something else you might find preferable for whatever reason you may have. In short, you simply reinvest the proceeds from the sales. The profits serve as a proxy for adding more funds, just like if you contributed by other means to build your own long-term portfolio.

Nothing mysterious in this, no "secret sauce". Just plain common sense. At most, a portfolio management procedure. Evidently, you will pick the best stocks you can find. You are not interested in anything that could go under. You intend to hold for a long time. Therefore, picking stuff that might last should be a prime directive. You will find plenty of those stocks in the largest listed companies.

We have computers. We want them to solve problems. But, there is this thing: they do not think. That's our job! There is no artificial intelligence software that will ever produce an assured winning program playing a heads or tails game with any kind of accuracy. All they will find is that the probability of the next draw is still one-half. But you already know this. Yet, over past data, they will be able to find all kinds of patterns that might repeat or not as examples showing that patterns do exist and are detectable. Regardless, as soon as they look at the next draw, all their data will have the same value as if you flipped the coin yourself, expecting heads half the time.

What You Have To Solve Is A Stopping Time Problem

I often use this common expectation equality: E[F(t)] = F0∙(1+ E[rm] + α)t. You could buy SPY and solve the problem this way: E[F(t)] = F0∙(1+ E[rm])t. Here, there is no alpha, almost by definition. You could add in a luck factor (lf) if you wish: E[F(t)] = F0∙(1+ E[rm] ± lf)t, but it would have no certainty and a zero expectancy (E[lf] → 0).

It is when you add some real talent to the task (α) that you will be able to surpass the most expected outcome: the long-term market average E[rm].

Sometimes, some confuse luck with talent. There is a major difference. Nonetheless, either way, when the money is in the bank, it's in the bank; you won.

This alpha is an expression of your added expertise. It is your method of play that has an impact on your portfolio's total return. It is easy to say: get some alpha; it is worth it. It is another matter to put it into code. You might not be facing a heads or tails game, but you are looking at one that, at times, behaves similarly or close to it. Which is what renders the game uncertain and full of surprises and pitfalls.

You Want A Solution To The Long-Term Portfolio Problem

This is not a game to be played for a short time, even if you can. It is not its purpose. It is not a working-day casino. If you are going to spend time on this problem, it better be productive for a long time. It is not after having put in so much work over the next 20+ years that you want to see your portfolio go under or see it underperform the averages (E[rm]).

You want to make sure before you even start, that the trading methodology you want to use will perform as intended, even under uncertainty. That is your job. The how you do it may be secondary. You intend to have a program do this job. Therefore, plan for it to do it well.

One way to show if your trading strategy could last for some 20+ years is to backtest it over a similar time interval. See how, in the past, it would have behaved. How it would have performed. See if its trading behavior was, in fact, an acceptable outcome. In 20 years from now, it will not be the time to say: my program would have done this or that. That will have absolutely no value. So, do it right the first time. There will be no rerun button available, only a startover from scratch.

This is what my DEVX8 test in my previous article was all about. A confirmation that the program behaved as intended and as programmed. That program has more to offer.

For instance, it has a retirement option. Activating it will allow contributions to be made up to a specified year. Thereafter, funds can be extracted on a yearly basis. Here is a demonstration under the same testing conditions. 

#1  DEVX8 - ABT – (with retirement fund option)

ABT - Retirement Option

(click to enlarge)  

The chart is very similar to the ABT chart in the last article. Except that this time, the retirement option was turned on. Still ending with a lot of cash reserves as well as a significant amount of shares on hand. The ending profits the program printed at the top of the chart is the total net profit generated, should the account be then liquidated.

The retirement option is interesting as the portfolio can still maintain a high CAGR. Was it not the objective in the first place that, at some point in time, your retirement fund should provide you with the income to maintain your lifestyle for years?

The Need to Grow

The first equality presented: E[F(t)] = F0∙(1+ E[rm] + α)t puts all the burden of outperformance in your lap. You generate the alpha, or you do not. A negative alpha and you will underperform averages. Doing so will have mostly wasted your time, if not your capital.

Notwithstanding, the expected market return E[rm], is not that high: historically, 8% to 10%. A 10% CAGR has a doubling time of 7.3 years. Therefore, it would take an expected 22.1 years to get: E[F(t)] = 8∙F0. This then puts all the emphasis on F0, the initial capital at risk.

If you want to play with a $10k account, then you should expect it to grow to $80k in some 22 years. Try to live on that in your retirement... (5% of $80k is $4k.)

The point being made is simple. The initial capital matters. In fact, it matters a lot. It is not just a case of finding your alpha. For the work that will be required over the years, one should seriously consider putting enough on the table to make it worthwhile.

The Randomness of Things

As expressed before, DEVX8 uses random-like functions to initiate or terminate its trades. You use the random() function, and some think you were just being lucky. So, a backtest without a seed should answer that question. If it is luck, you should win maybe half the time or see your performance swing all over the place.

To make that point: you do the test. So, here are 5 tests in succession where the only thing changed from the prior article is that these tests do not use a random seed. No code logic was changed in any way.

Evidently, it is expected that every run will have different answers since trades could be made on different dates with different quantities, if any at all. 

#2  DEVX8 - ABT – TEST #1 (no random seed)

ABT - test 1

(click to enlarge)

#3  DEVX8 - ABT – TEST #2 (no random seed)

#3  DEVX8 - ABT – TEST #2 (no random seed)

(click to enlarge)

#4  DEVX8 - ABT – TEST #3 (no random seed)

ABT - test 3

(click to enlarge)

#5  DEVX8 - ABT – TEST #4 (no random seed) 

ABT - test 4

(click to enlarge)

#6  DEVX8 - ABT – TEST #5 (no random seed)

ABT - test 5

(click to enlarge)

The 5 above charts do make the point. I could have made a hundred more and would get similar results. Just looking at the mid-panel at the bottom of each chart shows that trade placement could be at different times and of different sizes. You can see trade clusters at times as if the program identified better trading opportunities. As for the exits (red arrows), they are also differently distributed over the price series.

The only thing that did not change was the price series itself. Those are historical prices. The strategy changed its behavior due to the quasi-random-like trade triggering mechanism.

You have a program that is randomly trading, generating an unpredictable outcome, and still making overall profits every time. Even maintaining a 29%+ CAGR.

Doing Less Is OK Too

Should you want to reduce trade aggressiveness, you could use its built-in slider functions to reduce overall trading activity. The impact will be fewer trades. And therefore, fewer profits. For instance, changing the control settings (see the top of the chart) from 40, 98, 80, 40, 40, 40 to something like 30, 98, 80, 30, 30, 30, which would generate the following:

#7  DEVX8 - ABT – Control Settings: 30, 98, 80, 30, 30, 30

ABT - Controls 30 98 80 30 30 30

(click to enlarge)

We could reduce the aggressiveness further to 25, 96, 80, 25, 25, 25 which resulted in the following:

#8  DEVX8 - ABT – Control Settings: 25, 96, 80, 25, 25, 25

ABT - Controls 25 96 80 25 25 25 

(click to enlarge)

It all depends on the objectives you have, what you want to do, and how fast you want to go. Reducing the settings reduces the number of trade candidates, and therefore, fewer trades are taken.

I presented a future value expectancy function at the top of this article. But, like in the last article, let's go for the total expression:

E[F(t)] = F0∙(1+ E[rm] + α)t = F0 + Σ(H.∙ΔP) = F0 + n∙APPT

where the final outcome is much related to the number of trades being made and the average net profit per trade (APPT). That is what the game is about. If you want to trade. It is about numbers, only two numbers at that. One of which is just a counter.

Another way to reduce the overall impact is to downsize the initial portfolio. Say, instead of starting with $500k, you start with $250k and reduce the trade unit size to $5k per trade. To put this in perspective, with $5k, you can buy 100 shares of a $50 stock. It would result in the following:

#9  DEVX8 - ABT – Control Settings: 25, 96, 80, 25, 25, 25. Trade Unit: $5k

ABT - Controls 25 96 80 25 25 25 5k

(click to enlarge)

Again, no change was made to the coding logic or program procedures. The only changes made were to the controlling variables. The best would be to have them adapt as you go along, which was not the case for these tests. Here, they were fixed for the test duration. Nonetheless, they do show the ability to control what we might want to do.

It Is The Same Should You Want To Be More Aggressive

The easiest way is to provide enough capital to support a higher trade unit. For instance, let's use chart #7's settings, raise the stakes and the trade-unit to $15k

#10  DEVX8 - ABT – Settings: 30, 98, 80, 30, 30, 30. Trade Unit: $15k

ABT - Controls 30 98 80 30 30 30 15k

(click to enlarge) 

If you compare chart #7 to chart #10, you will see quite a difference in behavior, especially in the order placement. Increasing the trade-unit to $15k increased the total profit to $95.8 million from $64.8.

Using the same settings as chart #1 and increasing the trade unit to $20k produced the following chart:

#11  DEVX8 - ABT – Settings: 40, 98, 80, 40, 40, 40. Trade Unit: $20k

ABT - Controls 40 98 80 40 40 40 20k

(click to enlarge)

A trading strategy must have the ability to grow big. It must be able to handle its future size. It must remain sustainable, maintainable, marketable, and malleable over extended periods of time. DEVX8 can do all that, and it can do more. It is also scalable to much higher levels.

All the charts presented using ABT could have been done using any of the other 9 stocks in this example portfolio (see the previous article). I will leave it to another article to describe some of DEVX8's planned objectives, inner workings, and procedures.

It all boils down to this: what is it you want to do?

Whatever it is, it will end up with just 2 numbers: n and APPT. Therefore, you better start finding ways to control them and have them do what you want or find acceptable.

Trading alone will not give you this. Investing alone won't do it either.

Yet, combined, they can exceed both.

If you want more than averages, you will have to do more than what the average player does.

Created... November 9,  2017,   © Guy R. Fleury. All rights reserved