January 19, 2013

An Experiment II 

In my previous note: An Experiment, I chronicled the process of modifying the Livermore Market Key trading script after having issued a challenge to anyone wishing to show their system development skills. What follows is the continuation of that article starting with its ending.

After having canceled the challenge, I opted to continue to make modifications to the Livermore script. I had a few more hours that I could spend on improving the trading procedures within the constraint of having available funds in the account. Had the challenge lasted longer; it's what I would have done anyway.

This led to the Livermore after challenge where it was shown that the performance level had increased at the portfolio level while maintaining an 80% hit rate over the 6 years testing period. Again some might think that the numbers were manipulated, that there was some data fixing of some kind, but there wasn't. It was just the execution of a trading script.

All you had was a modified Livermore script that ran on Wealth-Lab servers using their simulation program and using their price data. Nothing except the script originated from my machine. It was like operating on a remote server somewhere on the web. I could not manipulate the data in any way; all I could do was supply a program to be executed. And had anyone else taken the challenge, it would also have been all they could have supplied: their own script.

To show that the performance results were not due to the stock selection process, there was only one way to make this point, and it was to redo the test using my modified version of the Livermore script. This time using a different stock selection. Again, if the script was any good, it would show in the performance results, otherwise, back to the drawing board. I think very few would dare to test drive live and in public. The reason is simple: usually a script might be considered over-fitted over a specific stock selection. Changing the whole stock selection is a more severe test than an out of sample test. What ever the trading strategy is; it will have never seen any of the price series that will be supplied, and therefore can not be seen to have been pre-adapted or fitted to the new series.

Modification upon modification to the original Livermore script had led to higher and higher performance levels. Even the after Livermore response (2nd act) had great results. It improved CAGR, was still able to maintain a 78% hit rate, and all this on a totally different data set. I think it was remarkable, but no one seemed to noticed... well, not exactly, at least I did. The high hit rate was, in my view, just a byproduct of the methodology. Usually, I am not even concerned with this metric and none of my programs take it into consideration. My methods do not play for an improved hit rate but for an improved payoff matrix.

To push testing even further, I opted to make another simulation on an entirely different data set. The point being that the second data set might also have been, by some, considered a fluke. With a third data set, I hoped the point would be clear. This last test also maintained an 80% hit rate with an impressive CAGR.

Now the Point to all This

I don't think I could have improved performance levels of the original Livermore script using traditional trading methods. Had I used technical indicators as most would have done, I also would have reached similar results as they would have. It was by looking at the problem from a different angle that I was able to achieve higher performance levels; it was by designing a trading strategy that would not only trade over price swings but also accumulate shares for the long term. It was simply by incorporating my own trading methods to the script that enabled me to transform the original Livermore script into something more, much more.

All the mathematical framework provided in my notes is there to explain how the improvements made to the Livermore script resulted in higher performance levels. The results were not achieved by luck, but by the application of trading procedures that looked at the problem with a long term perspective.

My improved versions of the program were executed over 3 different data sets just to make the point clear (128 stocks in all, 1,500 trading days each, some 19,000 trades per data set). All three tests had outstanding returns. Showed more than statistical significance in the areas where it counted most: test duration, number of trades and number of stocks.

But almost everyone was putting aside the relevance of these simulated tests, as if what ever improvements had been applied to the Livermore script, there was nothing there worth investigating further. I used the same tools they did, the same data series, but because I out-performed on their turf my results were now unbelievable. On my side, I had no problem believing the tests results they obtained, after all we were using the same simulation software.

My modified Livermore trading procedures worked over 3 different data sets of 43 stocks each and should have been considered a valid demonstration of the methodology used. For me, it did show that the underlying trading philosophy, what controlled the ensemble of trading procedures, had merit.

I easily understand that simulated results are no guarantee of future performances. In fact, they will never be the same. As we evolve, creating our future, everything will be different. Long term, each stock will follow its own path to higher prices or oblivion, and I'm not one able to determine which it will be.

However, we can back test to give us a general idea of what could have happened had we adopted a particular trading strategy over past data. And if the trading strategy can not show some profits over past investment periods, then I don't see why it would generate profits in the future. Therefore, a basic requirement from any back test should be to provide sufficient leeway that even if you miss, the results will still be interesting, if not to say impressive.

My Conclusions

My intent when the Livermore challenge was initially issued was to show that about any trading strategy could be improved by adding short-mid-long trading procedures to some long term stock accumulation process. I could have used almost any other trading strategy as basis for this demonstration. It is just that the Livermore Master Key script had a lot of market folklore attached to it. It also served to show that a quasi legendary reputation might not be sufficient proof that a trading method is worthwhile. This was demonstrated by the results of the original Livermore script when applied to the selected data set.

All this reverts back to the payoff matrix as presented in my other research notes: Σ(H.*ΔP). To show that a trading strategy is better than some other over the same data set and over the same trading interval, it is sufficient to show that:

Σ(H1.*ΔP) > Σ(H2.*ΔP) which requires that: H1 > H2

this will result in more profits being made by trading strategy H1. No matter what the composition of these trading strategies, the one generating the most profits might also prove to be the most desirable.

For a more elaborate view of the payoff matrix: see Winning the Game 1.1 or other related notes.

There can be other metrics that will influence strategy selection outside overall generated profits, but these are concerns over the general behavior of a particular trading strategy and each might be better analyzed for their individual merits. However, all other things being equal, one should prefer H1 as in: H1 > H2.

What all my research says is that one should view the trading game over the whole trading interval, not just as a trade to trade game, but a continuous flow of trades over many stocks over extended periods of time (read years). It's like: what do you do with H1, as a block, to improve your trading?

It's by looking at the problem with a long term perspective that one can better understand the requirements to achieve higher than the long term average expected returns. If you don't look at how your trading program will behave long term, how can it be prepared to handle it? You can't keep the same constant bet size over the whole trading interval, the reason is simple, your portfolio size should be increasing...

Take trading the 100 stocks of the S&P 100 index over the next 20 years. This would represent a price variation matrix ΔP of 5,000 trading days of 100 daily close to close price variations; some 500,000 data points. This means that whatever trading strategy one wants to implement, it will also have 500,000 trading decisions to be made over the portfolio's life. A do nothing (hold) is also a trading decision. And should you wish to have a trading decision every 5 minutes by operating on a 5 minutes time frame, then be prepared to have your program do some 39 millions trading decisions over the same 20 years. Increasing the number of stocks to be traded by a factor of 10 would also multiply the number of trading decisions by 10.

Simply looking at the payoff matrix: Σ(H.*ΔP), one will easy realize that it is not only extendable but also scalable to any size one might wish with for only constraint having the capital required to set it in motion. You want to trade 10, 100 or 1,000 stocks, the payoff matrix will accommodate; you want to cover 10, 15, 20 years or more, again it will adapt. The available trading capital will be the limiting factor as the portfolio evolves over time, but since the payoff matrix is scalable and expandable it should not be a problem to fit any scenario.

Stock investing is a compounded return game. The final outcome is the sum of all the trades; that they resulted in profits or losses. Your total profit will depend on all the trades you have taken over the entire investment period, it will depend on the total trading history. It can be, not only all the trades that have been closed over the portfolio's life, but can also include the sum of all unrealized profit or loss from still opened positions.

It doesn't really matter that you win in the beginning if you lose it all in the end. The outcome will still be the same: you lost. And if you design, from the start, to have your trading strategy fail long term; then you should not be surprised if it ultimately does fail. You can not assume that having designed a profitable trading strategy over a single stock over a couple of years that your system should prevail over the next 20 years for hundreds of stocks. It's not how the market works; please do your homework.

I've been trying to convince people since 2004 that a way to increase portfolio performance is to increase the bet size as the portfolio improves over time. But there everyone already agrees. You will find many trading methods that propose the same thing. It is easily understandable when you look at a payoff matrix.

That it be by using sub-Kelly numbers, equity ratios or increased leverage; everyone will concede that increasing bet size will have a tendency to increase performance levels over the long haul. Therefore, what ever concept I was trying to promote was not necessarily bringing anything new to the problem. But it is.

In the beginning, my methods do not make much difference compared to other trading methods. It is only when you consider the long term that the difference can be seen, and there the difference can be considerable. But to get to the long term, you have to be there every step of the way.

In the short term, making a profit on a trade is, how could I say this: well, it is peanuts on the whole scheme of things. You might need thousands of such trades to make your investment endeavor worthwhile. Look up any formula for a compounded return, say (1 + r)t and put in realistic numbers. You will find that time is the critical element, and to me, the doubling time is especially interesting. The doubling time is the time required to double your portfolio value; it depend on the appreciation rate (r). Look up my notes: On Doubling Time and On Compounding.

Say you have a 5 years doubling time; then 20 years will be required to improve your portfolio by a factor of 16. Even though interesting, not what I would call an over night operation or real over-performance for that matter.

Underlying what ever you might do, one way to achieve outstanding performance levels is to increase the bet size as you go. If not, don't expect to outperform. In time you will be forced to make bigger and bigger bets to keep your growth rate intact. And by making bigger and bigger bets you will be bound to make less and less productive bets requiring more and bigger bets. As the portfolio grows, you will soon realize that you can not flip your total portfolio on a daily basis even if in the beginning it proved a worthwhile endeavor.

The nature of the problem changes with time, portfolio size and holding inventory. The very nature of the game changes with the achieved performance level. In the beginning with a small portfolio you can flip your stock inventory with ease. However, as your portfolio grows, flipping your portfolio on a daily basis becomes less than sound if not practically impossible.

This will lead to designing trading procedures that will account for short-mid-long term objectives. I particularly like the Buffett style of investing; it has a vision for the long term and due to its accumulative stance show performance results that have beaten the averages for over 50 years (20%+ CAGR, a remarkable achievement). What my programs do is trade over such a stock accumulation process, an add-on which enables extracting short to mid term profits which can be put back to work to accumulate more shares. Wishing to do it all at the same time does require more complex programs since they do have to be prepared for what ever will come their way; short, mid, long term and all of it under uncertainty.

The payoff matrix: Σ(H.*ΔP) only say how much profit or loss is generated by applying the trading strategy H over the close to close price difference matrix ΔP. And what should be looked at are functions that can increase H over time, even independently to the trading strategy itself. For instance, if you adopt an increasing bet size based on a compounding function, it could be dependent on your portfolio's appreciation rate (r), you would get something like: Σ(H(1+g)t.*ΔP) which clearly should gradually out-perform its Buy & Hold counterpart for any positive g.

And that's all there is, it is up to you to find ways to implement trading strategies that will enable you to see not only the immediate outcome but to look farther ahead to see how your trading strategy will fare out with time.

All my simulation data says that it is possible to achieve higher performance levels by applying a trading strategy over a stock accumulation process. The above narrated modifications to the Livermore script is an example of this. And it is the sum of all the trading procedures, those with a short term vision as well as those with a much longer time horizon that make up for a better overall trading strategy design.

The original Livermore trading script was a reasonable, although a non-performing script. I would simply say having negative alpha. At least, it did not destroy your portfolio, just barely maintained it. In late August 2012, I opted to transform what I considered at the time to be the worst performing script ever published in a trading magazine. The script was so bad that some thought that just by reversing its logic it would be sufficient to make it an outstanding script; it wasn't. But by transforming the script, changing its trading philosophy, making it stop doing things that evidently were detrimental to its original goals, I was able to extract what some could consider positive alpha.

You can find an account of the transformation process here.

I would end this note with: if I could do it, then anybody can. After all, these programs were just a bunch of software routines, all of them freely available on the web. It was just a matter of connecting the dots. If you find it too difficult to design your own, I see only three solutions: 1) quit trying, 2) keep at it until you find the solution, 3) get outside help... if you can find it; long term rewards are worth at least that much.

Created... January 19, 2013 © Guy R. Fleury. All rights reserved. 

Alpha Project