July 11, 2016

Over the weekend, I was confronted with the problem of stock trading strategy survivability as I was reading Prado's book on optimization of trading strategies. Since a lot of what you see in the financial literature puts emphasis on that most trading strategies fail, I had to show that at least my preferred strategy was not designed to do so.

That was easy to demonstrate. All I needed to do was take an older documented version of my program, run it on the same stocks, and show what happened after the program was last modified. The same would apply to your own older programs. If you want to see if they might break down, simply do this kind of forward testing. You will have your answer quickly enough.

My current preferred program is DEVX8, and its latest test results were done last May and used a version dated November 2015. That test can be found in my Portfolio Drawdown article.

Nothing easier to do than an additional test. The program has not been modified since November 2015, that's over 7 months ago, and therefore, all the price data after November 2015 constitute out-of-sample data, data that the program has never seen and could not know about. One could also consider such a test as a walk forward but without forward optimization since no change has been brought to the program since last November. The program was technically frozen in time, but the new data wasn't.

The program would have to follow its code. It could not do anything else. Whatever was thrown at it, it would have to survive, thrive, or show its weakness. The only way to really compare the results was to take the exact same stocks as in the portfolio drawdown article. This way, it would be easy to see if the program behaved as expected or not over the added price data.

One could guess I knew the answer even before doing such a test. After all, I designed the program to do exactly what it does. Also, I've done this kind of test before.

Here are the same two stocks with 2 added months (47 trading days) of unseen data: 

#1  LOW  20.2 years (5,300 trading days)

LOW Chart

(click to enlarge)

#2  LMT  20.2 years (5,300 trading days)

LMT Chart

(click to enlarge)

The DEVX8 program prints on the chart a summary of the things I like to track. Should anyone want to compare with the last May run of the program, one would notice that both stocks produced more in the ending profit department. And therefore one should conclude that the trading strategy did not break down.

DEVX8 is a remarkable program. It can even be controlled from the outside. It has 10 settings in all of which only six were shown. They control the strategy's behavior. All entries and exits are the result of random-like functions. It even uses delayed gratification. This is explained in more detail in a 2-part article on a prior version: Delayed Gratification I and II.

With DEVX8, you never knew when or how much would be bought or sold, but in the end, that did not really matter since everything was being averaged in and averaged out. You go for the general trading behavior instead of trying to be explicit all the time and accept that randomness can play a major role in the price discovery process.

You want more, that too is easy, the program's trading is scalable. It operates on the basis of trade units, which in the above example was $10k allocated per trade. $10k on a $100 stock is 100 shares, so yes, it can be scaled up or down. Should you want 10 times more, then up the ante: increase the initial capital and the trading unit by a factor of 10. 

#3  LOW  20.2 years ($100k trading unit)

LOW Chart $100k

(click to enlarge)

#4  LMT  20.2 years ($100k trading unit)

LMT Chart $100k

(click to enlarge)

The ending cash reserves in both tests are relatively high and represent a high percentage of the ending portfolio's equity. It is where I should improve the program with a better allocation process which I believe would also increase performance further. But already, in its current state, it is not that bad a trading strategy. At least it can show not only that it can survive the test of time, it can play big or small, and it can also thrive by generating positive alpha.

The underlying principle is not that complicated, either. It says: accumulate shares for the long term and trade over the process. This way, combining short-, medium-, and long-term objectives into a sustainable long-term trading strategy.

Added Observations on the Presented Test. (added July 13)

Some might have noticed on both charts above that the hit rate was at 100%. Of the thousands of executed trades, closed or still opened, none exhibited a loss after their respective 20-year testing period.

Isn't that nice? Trading using random-like functions and still having zero losing trades after so many years. 

The reason is simple. In that program, shares are sold only when showing a profit, and the program simply waits for it. It will even wait for its profit acceptance through a procedure named random delayed gratification. 

You will have drawdowns. They are inevitable. As a matter of fact, almost every position saw some red. However, any time prices were making relatively new highs as compared to the highest purchases, not only would all closed positions show a profit, but all still opened ones would too. This is bound to happen repeatedly over such a long-term trading interval as the stock price goes from one high level to the next. 

The objective of that program is to accumulate shares for the long term and is therefore ready to hold for the duration. It is only that, after some time a position could be at a profit, and it is then that the program might decide to sell (using its random-like exit), thus the high hit rate. The generated profits are, in turn, funneled back into the system in order to buy even more shares. The system, in essence, is providing its own added capital, generating on its own a positive feedback loop. 

So, there you have the reason for the high hit rate. Not only is it possible, but it is the designed default mode of operation for the trading methodology itself. It is part of what was demonstrated in the DEVX8 trading strategy test. It was scalable at will, controllable from outside the program, and designed to last, and it could manage to do this with a high hit rate, not to mention its positive alpha generation.

Here is an example of LOW's MAE/MFE report:

#5  LOW  MAE/MFE   (20-year test. DEVX8, Nov. 2015 version)


(click to enlarge)

The top section says that of all the trades that saw some red, all finished positive since none remained below zero. While all the trades that saw some green (bottom panel, maximum favorable excursion), none finished or were at a loss. Note the bell shape of that distribution, something that could be expected in a random-like trading environment. 

Created... July 11, 2016,    © Guy R. Fleury. All rights reserved