November 18th, 2016

The previous article: Controlling a Stock Trading Strategy was to show you could control a trading strategy to do more than it had before by using mathematical functions that could impact its 3 most important portfolio metrics: n, u, and PT, namely the number of trades, the trading unit used, and the profit margin.

To show you could do more, a base for comparison was provided in the article: The Deviation X Strategy. With this, I will be able to compare the portfolio output under the same testing conditions using the same trading strategy over the same trading interval. I found it more important to see how one can take an existing trading strategy and push it to do more. A backtest is a demonstration that it can or that it cannot be done. Evidently, this article will go for: it can be done.

But whatever, a simulation won't change that there are only three portfolio metrics of importance, and if you don't improve on them, you will stay with what your trading strategy gives and go no further. And that in itself can be limiting.

The Deviation X Strategy, in its own right, had impressive performance levels. Nonetheless, slightly changing 3 of its controlling functions saw its portfolio rise by more than $145 million in added profits with no real negatives to the system since it generated better metrics in all the departments that count. Therefore, one would have to conclude that the increased numbers were the reason for the rise in profits since nothing else was changed.

Controlling a Stock Trading Strategy also ended with: you could do more since cash reserves, which were supposed to be used more and were, still went up by a substantial amount, indicating that there was more room, more than enough reserves available to do much more. As if the taken step was not the limit but just a step in the positive direction.

This 3rd test is being done under the same conditions as the other two: same stocks, same trading strategy, with the same trading interval of 5,387 trading days (this time plus 2 days), same initial capital, same trading unit, and same random-like trading. It will also be run once, as in the other two tests. Whatever the output, that is what will be reported. The objective is to show that not only can we increase profits, it can all be done with ease.

Trading will be more aggressive, increasingly taking more trades as equity rises and selling more as the ongoing inventory increases. As previously noted, the main objective remains the same, and that is to acquire and accumulate more shares. It is the primary task of the DEVX8 program.

To save everyone's time, instead of going little step by little step as in Controlling a Stock Trading Strategy, I opted to simply jump to a higher setting, not pushing the machine to its limits, but just a straight jump to a higher level of acquisition, since that is the main driver of the strategy: to build a long-term portfolio. Therefore, it should accumulate more shares along the way.

When I look at the internals of this program, I see a variation of the Buy & Hold theme. It stands ready to wait for a long time for its profit. But, if it did only that, it could only expect to reach about the same average performance return as the average.

You want more. So, you change the theme itself to a Buy & Weak Hold, meaning by this that for a price, you "consent" to sell some of your profitable positions, knowing that, most often, you will be able to replace them later at a better price.

The New Test

For this test, I changed 4 of the 9 settings. The same 3 as in the previous test which now will be raised to 40 from 30, and a 4th giving it a minor nudge going from 95 to 98. The first three settings have the same mission to increase trading activity. Raising their value to 40 is a demand, a request to do more and accumulate more shares in the process.

The fourth one is making a request to try to generate more profits over the whole process. To do so, it can raise PT as well as have an impact on n, and thereby increase the ability to acquire even more shares. Therefore, I should see the inventory rise due to the acquisition of more shares than in the previous tests and see profits rise due to the increased trading activity. Trades can only be executed if there is cash in the account.

The strategy will attempt to accumulate more cash in order to take advantage of more trading opportunities available within the allowed trading windows. Not only that but by raising PT, even just a little, it will impact all n trades taken since the profit formula is: n*u*PT.

First, let's see how ABT did on this new test.

#1  ABT -  November 16th test with controls: 40, 98, 80, 40, 40, 40

 (click to enlarge)

The ABT chart looks about the same as in the previous tests, except for the numbers, order placement, and quantity traded. Compared to the first test in The Deviation X Strategy, ABT added $ 57.2 million in profits raising its total to $ 98.7 million. To do this, it traded more, making 10,440 trades, of which 4,590 were closed, generating $ 69.9 million in profits. During the process, it added 1,484,650 shares to bring its total to 2,193,935 shares in inventory. Still had $ 11.9 million in its cash reserves. ABT increased its 20.72-year CAGR to 29.09%. The only number that came down was the percentage of winning trades, which was slightly reduced by 1.59% to 86.32%, and this reduction is not significant enough to matter.

We wanted ABT to do more, and it managed to come out ahead. It traded more, accumulated more shares, and even accumulated more cash in the process.

Here are the test results for the group:

#2   DEVX8  - Nov. 16, 2016, with controls: 40, 98, 80, 40, 40, 40

DEVX8 Nov 16

(click to enlarge)

The story for ABT is about the same for all the other stocks in the portfolio. They all traded more, accumulated more shares, and more cash. They all increased their long-term CAGR as well, raising their profit margins and cash reserves. Actually, they all outperformed ABT. In all, the strategy executed 99,058 trades with an impressive 91.44% average winning trades.

In total, compared to the first test, the portfolio added $ 996,828,862 in value to its original return of $ 661,918,539, bringing it to a grand total of $ 1,658,747,401. Now that is added performance for changing just 4 numbers!

In its share accumulation program, it acquired 7,043,896 shares valued at $ 664,389,306.

The portfolio under the (40, 98, 80, 40, 40, 40) control setting had for mission to increase n and PT in the portfolio equation: A(t) = A(0) + n*u*PT. And, I have to say, it succeeded.

Just as in the previous article: Controlling a Stock Trading Strategy, here is the difference table comparing this Nov. 16th test to the Nov. 12th test (Deviation X Strategy).

#3   DEVX8  - Nov. 16th test compared to Nov. 12th - Differences

DEVX8 Nov 16 vs Nov 12 Differences

(click to enlarge)

This new test, with its higher settings, managed to add 5.73% in long-term CAGR, getting it up to an average of 32.33%. The price to pay to execute all this appears to be a small reduction in the percent of winning trades which decreased by an average of -1.13% to 91.44%. The strategy did not break down, on the contrary. It thrived and appears to be ready to do even more if requested.

Within these 3 tests, it was shown that DEVX8 was scalable up or down. It is a matter of adjusting the initial capital and the trade unit u by the desired factor.

If I wanted, I could easily choke the positive feedback loop to the point that no added profit would be generated due to having choked the strategy's ability to trade. You design a trading portfolio not to do less but to do more than the averages. 

If one does not program his trading strategy to build on its gains and survive for years, how will it ever know how to do it? It is the system designer who has the task of building trading procedures that can funnel the output of a portfolio in the desired direction. The task is not that big. You have only a few metrics of importance to deal with (3 in all), and some you can set yourself. Again, see the equation: A(t) = A(0) + n*u*PT.

What is the takeaway on this one?

These three simulations over the same stocks over the same trading interval using the same program have shown that one can push an existing trading strategy to do more, to extract more profits than just letting it do what it did before.

You can direct your own programs to use its generated profits to trade more going forward creating your own feedback loop to finance your trading operations. You can take your existing program and push it to do more simply by reinvesting generated profits.

Note from chart #2 that the portfolio ended with $ 994,362,313 in cash reserves, some 60% of equity. More than enough to again do much more. I know I can improve on the design by using some of those reserves. I designed a trading strategy to accumulate shares over the long term, and I ended up with a stock trading strategy that accumulated more cash than shares. But, for the moment, I find it an acceptable compromise.

There is nothing extraordinary used in this strategy, sure the program is complex having over 2,300 lines of code, but the principles are simple, and the output even more. It is the task of the strategy designer to take what is complex and make it simpler.

The portfolio equation is A(t) = A(0) + n*u*PT, and it does say where the profits come from since A(t) - A(0) = n*u*PT. Those are 3 numbers you can transform into the product of 3 functions: n(t)*u(t)*PT(t) having for unit a dollar sign.

This is kind of a reality check. Whatever you design as a trading strategy it will be governed by these 3 numbers. It also demystifies anything you might do. If you average $ 100 profit per trade, you just took care of u*PT. All that's left is n, the number of times you can do it. Now, I don't think anyone should have problems making an estimate of what their trading strategies can do and how long it will take to reach their goal. There is no psychology in this, no sentiments, just business, just bean counting.


You have a trading strategy, do your backtest, accept the results, and that's it. When it could be just a starting point. Was given here the results of 3 simulations using the same program. I didn't change the program's logic or a single line of code, only 4 constants, knowing even before making a backtest that it would result in a higher performance level, to the point that this last test generated close to a billion dollars more in profit. All because I changed 4 numbers... If I wanted the strategy to produce even more, I would simply increase the control settings a bit more again.

I think anyone can do this using their own stock trading strategy. But then again, maybe not. I haven't seen any trace of this in public view.

You Want More, Then Push for More

Follows the 9 other stock charts as verification for the numbers presented in chart # 2:

#4  ALL -  November 16th test with controls: 40, 98, 80, 40, 40, 40


 (click to enlarge)

#5  BIIB -  November 16th test with controls: 40, 98, 80, 40, 40, 40


 (click to enlarge)

#6  CVS -  November 16th test with controls: 40, 98, 80, 40, 40, 40


 (click to enlarge)

#7  FDX -  November 16th test with controls: 40, 98, 80, 40, 40, 40


(click to enlarge) 

#8  GD -  November 16th test with controls: 40, 98, 80, 40, 40, 40


(click to enlarge) 

#9  GILD -  November 16th test with controls: 40, 98, 80, 40, 40, 40


(click to enlarge) 

#10  HD -  November 16th test with controls: 40, 98, 80, 40, 40, 40


(click to enlarge) 

#11  LMT -  November 16th test with controls: 40, 98, 80, 40, 40, 40


(click to enlarge) 

#12  LOW -  November 16th test with controls: 40, 98, 80, 40, 40, 40


(click to enlarge)

Created... November 18th, 2016,    © Guy R. Fleury. All rights reserved