Jan. 16, 2019

In Part I, it was shown that a trading strategy could be expressed as a simple equation. The outcome of that equation gave the sum of all winning and losing trades. You would have a number of losing trades and the rest would have an averaged profit making the strategy worthwhile or not.

The equation was: Ʃ xi = (n - λ)x+ + λx- where λ was the number of losing trades, x+ the average profit per winning trade, while x- was the average loss per losing trade. The equation says, of all the trades taken there will be λ losing trades with an average loss per trade of x-. The remaining trades will be at an averaged profit.

Each time a simulation is performed, those numbers become available for analysis and can help to statistically describe what the trading strategy has done over the period where it was applied. To know the average profit or loss per trade is simple, you take the sum of all profits and losses Ʃ xi and divide it by n the total number of trades. You know the average profit or loss will tend to some constant the more the number n of trades is large. A direct consequence of the Law of large numbers. You also know you will not win all the trades all the time, hence λ.

Put the equation in Excel, it is not that complicated. Take some of your own simulation results. What it will show are some of the limits your trading strategy might have. Without knowing these limits, what kind of expectation can you extract from your strategy?

Following is a snapshot that could get you started. I used Leo C's tearsheet as an example since it had "round_trips=True" in its backtest analysis. Thanks, Leo.

Strategy Equation

Strategy Equation 

(click to enlarge) 

Is presented a general section and an example from the cited Quantopian tearsheet. The first column increases the number of trades by a factor of 10. The win and loss rates determine the percentage of trades that finished with a profit or loss. The average win and average loss columns give the average amount won or lost per trade. The rest of the columns take the total profit Ʃ xi to give the CAGR corresponding to the number of years it could have taken to get there. The yellow cells are used to build scenarios based on the equation at the top of the chart, the rest are formulas.

There Is Math To This Game

That we like it or not, there is math to this game.

The equation above prevails no matter what is the composition of your trading strategy. The above table says a lot. The more trades are performed (while keeping the same edge) and the shorter the time interval used to do the job, the better the CAGR.

Thereby saying, the number n of executed trades matters. And how long it takes to execute these trades matters too. It is like if you were in this race to terminate your n trades as fast as you possibly can.

Performance degrades very fast should you take longer to execute the same outcome as illustrated in the following chart which uses the “n = 10,000” line. It does say that the longer you take to execute all those trades, the lower the CAGR will be. And it degrades fast. Note that using another line will only change the scale, not the shape of the curve.

Strategy Equation CAGR

Strategy Equation CAGR

(click to enlarge) 

What should we take out of this? We should look at the numbers and figure out how we could improve on them no matter what our trading strategy may be. With all other things being equal, we could look at the problem from the point of view of one variable at a time. We increase the number of trades over the same time period, it improves the picture. We reduce λ the number of losing trades, we improve the end results. We compact those trades into shorter time intervals, that too will improve performance. We positively increase the spread (the strategy's edge) between our average win and average loss, it will also improve overall results.

These measures did not deal with the nature of the trading strategy, only its math and how it will end. The what we do to accomplish this task could be anything that shows its mark in a backtest, even if it is not related to the way we usually operate, as long as there is some logical reason for it to do what it does.

It might not even matter if you are operating of the fumes of white noise to get your performance as long as you get it and that there is some rationale that can justify your method of play. You want to game the game, go ahead, but know why you are doing it while keeping a long-term vision of the goals you want to reach. Gambling your way out based on your know-how is also admissible. Your trading account will not be able to tell the difference either way or which trading methods you used. In fact, it will not even care what you used to make the account grow. It will only tally the results one trade at a time.

If you modify your code and the number of trades is somehow reduced, the other variables in the equation will have to work harder to compensate. And if they do not, the strategy will degrade even faster. You are not in a search for some equilibrium, the real task is to maximize the outcome Ʃ xi using whatever you have available and do the job as fast as you possibly can.

A simple question like: how do I increase the number of trades becomes important? You know it will have an impact if you do so, then it becomes your task to make it happen within the limitations of your trading account. A simple solution would be to do more of whatever your strategy is already doing which, on average, provided you with your positive edge.

For instance, under the same trading conditions as Leo's tearsheet, one could find ways to increase the number of trades per year. From the tearsheet charts, trading volume, exposure, number of trades are relatively constant. Therefore, and due to the size of the sample, we could use those numbers as averages to make projections on an annual basis.

Doing More

A few lines were added to the first chart as shown below:

Strategy Equation Enhanced

Strategy Equation Enhanced

(click to enlarge) 

It starts by converting to a per year basis (see "IF per year" line) where the number of trades becomes the average per year. Each year, the average outcome is added to its performance. We can still see the CAGR degrading over the years. This view is more realistic than the previous one since they do match what is coming out of the tearsheet. Therefore, the strategy, with no fault of its own, will see its CAGR degrade with time as if the strategy was breaking down when all that is needed would be to compensate for the deterioration.

To compensate the CAGR degradation, it appears sufficient, in this case, to increase the number of trades by 2.3% per year. This is not a major move. It is adding over its first year 261 similar trades to its 11,353 (about 1 trade per day).

If the 2.3% increase was sufficient to maintain the long-term CAGR, going to 5.0% is enough to see the CAGR rise over the years. This is an expanding CAGR. The more you trade, the more you get while doing the same things as before.

It is easy to compensate for long-term CAGR degradation. It can be done on any trading strategy. And if you wanted more, increase the number of trades even more as illustrated in the 10.0% line.

It is all one's choice. You code your trading strategy to do what you want it to do while faced with uncertainty. Except that, you should want to organize everything in such a way that in the end, you will win no matter what.

This is far-reaching. For all those that think that all trading strategies fail, well, think again, it is not necessarily true, except if you want it to. But, let it be said that it is your choice to compensate return degradation or not. You do not intend to do it, then be ready to accept the consequences.

Not only can you compensate for the inherent CAGR decay seen in most trading strategies, but you can also reach the expanding CAGR level by finding more ways to increase Ʃ xi and thereby compensate even more. This is covered in more detail in my book: Building Your Stock Portfolio.


Created... January 16,  2019, © Guy R. Fleury. All rights reserved