January  26th, 2016

A Stock Trading Strategy Experiment III

In Strategy Experiment II, I presented a stock trading strategy based on the MACD, a technical indicator often used in developing strategies. In Trading Strategy Experiment I was shown that such a minimalistic based trading strategy would not produce much over the long term. However, in Strategy Experiment II, it was shown that it could be transformed and used to produce interesting results at the portfolio level, and over the long haul.

In order to increase stock portfolio profits further, I needed to deal with what would affect the entire portfolio payoff matrix (now 5,189 days by 10 stocks), and not just what I could averagely detect from the ABT price vector, but stuff for the other 9 stocks as well that have not seen the program's added code and modifications.

I opted to increase n, the number of trades. The reasoning is simple, it is the easy route.

If the average Δp is > 0, then n + Δx trades will bring more profits. Doing this, I could accept a smaller Δp or a smaller Δt, whichever I preferred, as long as it was general in nature since I would have to apply these trading procedures and modifications to other stocks that were not part of the sampling or debugging process.

What I expected at the portfolio level was to see each of the other 9 stocks show improvements in most of the metrics of importance, and naturally a higher overall profit level.

The test results are presented in the same format as earlier. This way a strategy comparison can be made. Is version 03 really better? Is Σ(H(MACDv03).*ΔP) > Σ(H(MACDv02).*ΔP)? The answer is: yes, definitely.

   #1   MACDv03 Summary Report. January 25 test.
 Summary Report

(click chart to enlarge)

The last line of the above report gives the added value, and it is certainly more than reasonable for a few lines of code. I particularly like some of the exit techniques used in this one. More refined. Here are two representative charts: 

   #2  CVS MACDv03. January 25 test.
CVS

 (click chart to enlarge)

   #3  LMT MACDv03. January 25 test.
LMT

(click chart to enlarge)

 The point to make is this: I dealt with the whole payoff matrix as a block of data, with its 51,890 decision points. There is some randomness in the exits, a delayed gratification routine used to skip an acceptable and accepted exit, giving it a chance to wait another day or more for an even better exit should it be found. Before doing the test, I also changed the seed of the random number generator in order to have the trades fall where they may.

I think chart #1, the portfolio level report, show quite impressive numbers, even if I have to say so myself. The MACDv03 is definitely more productive performance wise: Σ(H(MACDv03).*ΔP) > Σ(H(MACDv02).*ΔP).

My intention was to increase the number of profitable trades at the portfolio level without even seeing 9 of the selected stocks. On this, mission accomplished: 4,525 trades were added over the 20-year time span. More positions were closed: 1,962 and the percentage of winning trades increased.

Closed positions added some $59M to the January 18th test, another $15M in profit is in still opened positions for a grand total of $74.8M added to the portfolio.

The system accumulated more shares, 536,478 more, collectively valued at $41M which was added to the existing inventory. About 2 alpha points were added to the January 18th test, pushing the portfolio's CAGR higher to 27.96%, resulting in an equivalent doubling time of less than 3 years.

Overall, the January 25 test generated $272,302,129 in profits from 15,661 trades. The performance differences are summarized in the following table. 

   #4   MACDv03 Summary Report - Differences. January 25 test.
 Summary Report Differences

(click chart to enlarge)

 The added portfolio profits could be viewed as the opportunity cost of not adding the code modifications. Providing a kind of incentive to always search for more, new and at times simply different ways to reach your objectives.

It is my contention that anybody can do this. If I can, be assured, anyone can! It only requires a slight change in perception.

The question might be: how would you design a trading strategy that has for mission: to accumulate shares for the long term while trading over the process? And if you look closely at how you could do this, you will figure out the same things I did.

Long term, the Buy & Hold people win the game big, not the day to day traders. But, the Buy & Hold is limited performance wise. Your best expectation is to achieve about the same as an index fund if you diversified enough. If you want more, you will have to do more.

This thing says trade all the swings and keep some shares for the long haul. Based on the numbers presented, it does not seem like that bad an idea.


Created... January 2th, 2016 © Guy R. Fleury. All rights reserved. 

Alpha Project