February  8, 2016

My take on my Stock Trading Strategy Experiment.

The whole Strategy Experiment had two surprises. The first one is that the MACDv03 program managed to outperform one of my preferred strategies: DEVX8. The second is how unexpected it was since it was not my primary objective.

My objective was to show that you could take an ordinary trading script and transform it into a portfolio builder. I considered the task a worthwhile experiment, hence the title.

It is also why I opted to do it live, posting the results as I went along. A way of forcing me to look for better solutions and be more creative.

First, a recall.

Stock Trading Strategy Experiment I started by showing that using a MACD-based trading system would not be that profitable over the long haul (20 years). The result, as expected, and although positive, did not even outpace leaving the money in a bank account. It represented 20 years lost in the pursuit of practically nothing. And if the trading strategy did nothing over its past 20 years using market representative stocks, what do you think it reserves for the next 20 years? I would say nothing.

Nonetheless, from there, I proceeded to make modifications to the provided code.

Stock Trading Strategy Experiment II & III showed that by changing the trading philosophy of the program, giving it more of a buy-and-hold stance instead of just trading away, one could increase performance. From trading only, the strategy evolved into an inventory accumulation program which allowed continuous trading over the process. That made a tremendous change in the layout of the program and how it would behave in time.

The same data set from 8 months earlier was again used in these portfolio simulations. A way of keeping a comparative posture. An attempt, at the same time, to answer the question: is strategy A better than strategy B?

In payoff matrix notation: Σ(H(MACDv03).*ΔP) >? Σ(H(DEVX8).*ΔP). Will the payoff of the MACDv03 program outperform DEVX8 when compared on the same basis? It has the same starting capital, the same duration (20 years), and the same list of stocks in the portfolio. Consequently, the same price series to contend with. DEVX8 has external controls which could still enable it to surpass MACDv03. It would take too much space to elaborate on this at the moment.

I consider that anyone using their own software could do this or better. They could start with a portfolio test using the same list of stocks over the same time period with whatever their best trading strategy. For all 10 stocks in the list, the start date was 08/06/95, an arbitrary date (08/06/15) when the list was first requested with its 20 years of price data. This way, you, too, could answer this rather simple question. It goes like this:

Is my best stock trading strategy better than those 2 from that guy?

Is: Σ(H(MyBestStrategy).*ΔP) >? Σ(H(MACDv03).*ΔP) > Σ(H(DEVX8).*ΔP)? For me, if you don't even bother to do this test, it is because you already know the answer. Note that an opinion is not sufficient; only a test: only the output of your software performance report can answer the question. Any unsubstantiated claim that your trading strategy is better, understandably, is not enough. Without the numbers, all you have is an opinion, and an ethereal one at that.

One sentence is sufficient to describe MACDv03, DEVX8, or my other stock trading strategies for that matter: accumulate shares for the long term and trade over the process. That's it, and it is all-inclusive. For me, it says everything and every word counts.

Some might look at the results in Stock Trading Strategy Experiment IV and be prone to say: this is not possible, it's all hype, no one can design a trading strategy that can last for 20+ years and be profitable to that level, certainly not using a MACD indicator.

I would say: look again at the numbers, look at the methodology, look at the progression leading to Stock Trading Strategy Experiment IV, and at the same time, why not also take a look at the update at the end of it where scaling up by a factor of 10 was applied to the strategy. It shows that if you wanted it big, you could make it big simply by putting more on the table; in that case, 10 times more. This showed that it was more than worthwhile to search for more initial capital. You could also scale down by a factor of 10 if desired. Both programs, MACDv03 and DEVX8, were designed to be scalable, up or down.

There is no hype here. But there is some thinking differently, definitely a different trading methodology than what we usually see. All of it starts with relatively basic stuff. I'll try to address some of it here.

If I want to build a long-term stock portfolio, I would apply some kind of basic restrictions in the stock selection process right from the start. If I want to accumulate shares for the long term, it should be a given premise that the potential stocks considered should have some kind of forward-looking positive expectation. It is the same as saying: I should make the best stock selection I can, based on all the information I can get prior to even buying a single share. It should be kind of a Buffett-like process heavily based on fundamentals, the same as if buying part of a business. Since you would not buy a business going bankrupt, then why consider doing it with stocks?

Building a long-term portfolio is not an academic adventure where one randomly picks some stocks from an infinite population taken from whatever source is out there. Nor would picking penny stocks for the long term have any enduring positive average expectation.

Most certainly, one can put some insight into their stock selection process before even purchasing a single share of any stock they intend to carry in their long-term portfolio. And long-term means just that, a stock you think, now, that can possibly survive and further increase in price going forward.

If it does not pan out, you will be getting rid of it anyway, but at least do the prerequisites and do the job properly. It should be a bare minimum. In street jargon, they call it: due diligence. It is more like knowing what you intend to hold in your portfolio. It might stay in it for quite a while.

That does not say or guarantee in any way that the selected stocks will prosper. Only that they had the potential to do so, to have their price go up over time. A stock could still go bankrupt going forward, but that was not the premise for selecting it. You don't want to accumulate stocks that are going bankrupt. It would be more than counter-productive. And it certainly is not your mission.

So, just the word: accumulate, implies that you will have to do your research to determine if the stock you are analyzing has a favorable positive outlook. You could have ample time to dump the stock later should it not live up to your expectations.

Hypothetically, take 20 stocks, all selected for their long-term potential. You don't know how they will pan out some 10 or 20+ years from now. There is no way to determine that either. There are no current mathematical tools whatsoever that have demonstrated, or that can give you such precognitive abilities. There are no probability measures of any kind that can give you what will be the price of a particular stock 20 years from now. You can be assured that a martingale which states: E[p(t+1)] = p(t), which says: the expected price tomorrow is the price today, is not the answer since it leads to p(T) = p(t) = p(0), right back where you started. And that is not what you see when you look at stock prices in general.

But you do know now that whatever the selected stocks do going forward, you will be able to express where they will end up in CAGR terms: CAGR = (p(T)/p(0))^(1/t) -1. If you display a group of stocks with various CAGRs on a logarithmic chart, the graph might look like the following:

#1  Portfolio CAGR Distribution (20 stocks - 40 years)

CAGR Contribution

(click chart to enlarge)

You get a number of lines spread out like a fan, each representing a stock's CAGR over the trading interval (40 years, 2% steps, range: +/- 20%). In the real world, the numbers would be different, just as the fanning-out distribution. The actual stocks would also have an unknown and unpredictable performance level. They would probably tend to aggregate around the mean for the group. You would not be able to identify which stock will do best or which one will do worst.

But all that won't change the nature of the graph and what it says: some of your stock selections will prosper better than average, some won't, and some will go bankrupt. This is no matter how much effort you put into your initial stock selection process.

Evidently, from such a chart, one should have put all his/her trading capital on the top line: the highest performer of the lot. Anything else would be, and is, sub-optimal, including any combination of the lot. As second best, one might select the first 3 to 5 top lines on the chart and ignore the rest, kind of averaging things out due to some uncertainty. There is only one problem with that: you can not say now which one of your selected stocks will perform best, nor can you put some order to the outcome! There is no prescience available, none at all.

Future CAGR results will look like chart #1. But the outcome for any of the 20 stocks will be completely unpredictable. You might think you picked ST1 as the best performer when, in fact, it could turn out to be ST20, the first one to go bankrupt.

No matter how carefully you selected your stocks, no matter on which set of values you determined that a particular stock deserved to be in your long-term portfolio, things could still go bad for some of them.

So, you draw a line in the sand. In the following chart, it is the red dashed line across the graph.

#2   No Under Performers Allowed

No Underperformers

(click chart to enlarge) 

The red line has a simple interpretation. Any of the selected stocks that fall below it are weeded out, and accumulation stops. They will have an impact on your portfolio (you will be accepting some losses), but it will be minimal when compared to the end results. It is your responsibility to make it so. Note that this is very easy to do.

Both of the programs mentioned have the following line of code at the start of their respective trading procedures:

if PriceClose(Bar) > InitPrice then begin

which is saying that you can consider a possible purchase tomorrow if, and only if, the EOD price is higher than the recorded initial price of the series. It could also be the price of the first trade. This limits buying or adding to inventory only at prices higher than the initial price. In a way, cutting off accumulating shares on any downer, thereby limiting the bet size and capital allocation to non-performers. The red line in chart #2 acts as a show and tell or else. Your selected stocks have to show that they merit your support, and to do this, they have to survive above the red line. That is simple and easy to code.

With such a simple instruction, many of the notions related to the downside are minimized. There are no falling knives to catch below the red line. There is no accumulation in the hope the stock price will rebound. There is only this notion: if the stock was as good as the initial due diligence had shown, then it should travel a path, however erratic it may be, above the red line.

And those are the only paths worth following. Your objective is to accumulate shares in the stocks that survive above the red line and trade over the process. You are in it for the best performers in your selection.

Whichever stock is not performing to your expectations can always be replaced with a more promising candidate which also will have to survive and adhere to your trading rules. One benefit of this process is that you will be accumulating shares of the best performers, and over time, your trading strategy will tend to reward more the best of the best performers. Thereby reaching the end game with the highest portfolio weights in the highest CAGR lines on chart #2.

You started with not knowing what would be the end game. You knew that the outcome would be like chart #1. You could not predict where each of the stocks would fall CAGR-wise. No precognitive ability whatsoever. Yet, you end up with most of the money coming from the best-performing stocks in chart #2 and in the same order. Your trading method kind of sorted out not only the best performers but also gradually allocated most of the portfolio weights to them.

You have a more elaborate exposé of the process in my book Stock Trading Strategy Mechanics, where it is explained that the feedback loop created by rolling up the inventory and reinvesting the profits will produce the most profits from the stocks that rise the most. You were not worried about survivorship bias. You were creating it yourself for your portfolio as a side effect of your trading methodology.

This changes somewhat how to consider the nature of risk. What is the risk when you come to play with house money? What is the risk if, when you decide to quit the game down the road, you are ahead? And if you look at the test results of MACDv03 or DEVX8, those could be in the vicinity of big numbers.

There might be a Stock Trading Strategy Experiment VI.

Created... February 8, 2016,    © Guy R. Fleury. All rights reserved.