November 16th, 2016

Controlling a Stock Trading Strategy

It was said in: The Deviation X Strategy, that it was controllable. When saying something like that, I like to provide some kind of evidence that what was said holds.

The DEVX8 stock trading strategy has nine controls that can be viewed as sliders or knobs. Each having its purpose. Only six are shown on a chart (see chart #1 below: Control Setting, top left, second line).

As a group, they manage trading aggressiveness, guiding the trading strategy to do more of this, or less of that. It can be a matter of taste, of objectives, or simply as I call it: trade aggressiveness.

You want more, you have to push for more. As simple as that. You have only 3 portfolio metrics to take care off, namely: n, u, and PT. You increase any of them and your overall profit rises.

By changing control values, you are not tweaking a system or optimizing it. You are making requests, demands, giving the program general guidelines that can and will impact every trade the trading strategy will make over its entire investment period.

It is not a trade here or there helped by changing the lookback period of some indicator. The changes are system wide, all trades are affected by these numbers. Insignificantly at first, looking for a penny more on a trade or simply adding a trade here and there. But, it will build with time due to the internal positive feedback loop generated by the trading activity. The process will feed on itself, by trading more, generating more profits, and enabling to trade even more.

It is like a compounding function which you boost slightly into higher gear: (1 + r + f(g) )t. It is sufficient to have f(g) > 0 to increase performance.

The governing portfolio equation is: A(t) = A(0) + n*u*PT. We can either increase the number of trades, increase the trade unit, and/or increase the percent profit per trade with for result an increase in overall performance. In this scenario, the trade unit is fix, so you are left with increasing n and PT across the board.

The primary design for DEVX8 was to accumulate shares over the long term. That is its mission. It is not to trade, but to accumulate shares, build a long term portfolio. The trading is done in order to accelerate this share acquisition process. Generating money from the trading to accumulate more shares that you stand ready to let go for a price (read a profit).

When you analyze a chart like ABT below, you see sales done in an upswing to be repurchased later at a lower price. There are more buys than sells. The program is designed to accumulate shares. There is no surprise there.

#1  ABT  - November 12th test with controls: 40, 95, 80, 28, 25, 25

(click to enlarge)

If I redid The Deviation X Strategy test with, for only change, higher control settings, then performance results that would ensue would have to attribute the higher return to the change in control settings. The program trades on random-like functions. That will not change the nature of the program, it will continue to do what it is supposed to do. There is nothing mysterious in that program, it just follows its mathematical functions as instructed. And, be assured, I have not found a way to beat the flip of a coin.

Since, none of the program's trading logic will be changed, the origin of the added profits will have to come from the change in control settings.

For this test, I opted to change only the last 3 numbers. In essence saying: increase the profit margin a little, accumulate more shares, and increase selling nearing highs. Overall, increase trading activity, take a more aggressive stance, and use more of those cash reserves.

To recap, here is the summary from the previous test: November 12 test: 

#2   DEVX8  - November 12th test with controls: 40, 95, 80, 28, 25, 25
DEVX8 Nov 12

(click to enlarge)

This new test needs to be done on the same basis as in chart #2, using the same stocks, over the same trading interval, with the same initial capital, and using the same trade unit. This way, we will be comparing oranges to oranges. And the only difference in the two simulations will be those control settings.

Oh yes, there is another difference. Since all trades are randomly generated, each stock will be sliced and diced differently. But the program is designed to handle that and therefore it does not represent a problem. On the contrary, it provides the system with a throw me what you got attitude.

Here is ABT under its modified control setting:

#3  ABT -  November 14th test with controls: 40, 95, 80, 30, 30, 30
ABT Nov 14

(click to enlarge)

There are improvements in chart #3 compared to chart #1. In fact, about every metric improved. ABT, closed 503 more trades, and kept an added 345 opened positions for a total of 848 more trades. The percent of winning trades increased by 0.56%. It added $ 6.6 million in profits from closed positions, and another $ 2.8 million in still opened positions for a total $ 9.4 million in additional profits. Adding to its inventory 155,750 shares. It increased the inventory value by $ 6.2 million, and increased its market holdings by $ 3.4 million. Adding 1.22% to its long term CAGR, raising it to 25.07%.

The New Test

With the increased control settings, DEVX8 generated $ 807.5 millions (see #4).

#4   DEVX8  Nov. 14 2016 with controls: 40, 95, 80, 30, 30, 30
DEVX8 Nov 14

(click to enlarge)

Slightly changing 3 numbers, and the portfolio generated $ 145.5 million more in profits. A difference chart will show where those controls impacted the total outcome.

#5   DEVX8  -  Nov. 14 2016   Differences
DEVX8 Nov 14 Diff

(click to enlarge)

As can be seen, ABT was not the only stock affected by the increase in control settings, all of them were, and positively, whatever their individual signatures. Most stocks did even better than ABT.

In all the metrics that mattered, there was improvement, especially in the profits department. Controls went from: (40, 95, 80, 28, 25, 25) to (40, 95, 80, 30, 30, 30), only the last 3 changed, increased by a small fraction, and it added $ 145.5 million to the trading account.

Are there reasons for this? Yes. The increase in profit is not by luck, even if the system trades randomly. It is uniquely due to the trading procedures in place in that program. If I played intermediary numbers between: (28, 25, 25) and (30, 30, 30), I would get results in between as well, as it should. On the other hand, I could push it, and move higher than (30, 30, 30) which would produce even more profits.

The new test did not require adding capital to execute the added 10,729 trades. It was all done from the ongoing reserves which nonetheless kept growing. The strategy added $ 94.2 million to its cash reserves, raising its total to $ 456.0 million.


What should one conclude from this? First, DEVX8 is a different approach than what we usually see in portfolio management systems. Second, it must be hard to do. On this, not at all, anybody can do that. You have all my recent articles that explain the mathematical backdrop for doing this. You simply adapt your current stock trading strategy to those principles.

What this last test shows is another form of portfolio control.

You have a trading strategy where you want to improve its performance level, and instead of over-tweaking and manipulating its data to fit your desired results, you simply give it directives like: do more of this and more of that just by changing a few numbers. You want to accelerate the system, increase the controls. You want to slow down, go ahead, no problem, it will slow down. You think you are near a market top and wish to be more in cash, no problem, just lower the controls and let the program select its exits.

The test in chart #2 ended with 55% of equity in cash. So it was easy to ask the trading strategy to use more of it as it went along. But even if I asked the system to trade more and generate more profits, it ended up with even more cash reserves (56.5%) indicating that you could raise on the controls even more.

Not being aggressive enough in our trading is also an opportunity cost that we face. But that one is self made, self imposed. There was no added effort, no additional capital required, just a machine working a few seconds more every day.

Nonetheless, slightly changing 3 numbers forced the program to add $145.5 million to its trading account, not by luck, but simply because the demand for more profits was made. 


Here are the 9 other stock charts as verification for the numbers presented in chart #4: 

#6  ALL -  November 14th test with controls: 40, 95, 80, 303030
ALL Nov 14

(click to enlarge) 

#7  BIIB -  November 14th test with controls: 40, 95, 80, 303030
BIIB Nov 14

(click to enlarge) 

#8  CVS -  November 14th test with controls: 40, 95, 80, 303030
CVS Nov 14

(click to enlarge)  

#9  FDX -  November 14th test with controls: 40, 95, 80, 303030
FDX Nov 14

(click to enlarge)  

#10  GD -  November 14th test with controls: 40, 95, 80, 303030
GD Nov 14

(click to enlarge)  

#11  GILD -  November 14th test with controls: 40, 95, 80, 303030
GILD Nov 14

(click to enlarge)  

#12  HD -  November 14th test with controls: 40, 95, 80, 303030
HD Nov 14

(click to enlarge)  

#13  LMT -  November 14th test with controls: 40, 95, 80, 303030
LMT Nov 14

(click to enlarge)  

#14  LOW -  November 14th test with controls: 40, 95, 80, 303030
LOW Nov 14

(click to enlarge) 

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

Alpha Project