July 29, 2018

A stock trader deals in standardized pieces of paper representing his share of ownership which can easily be auctioned in a public marketplace. You buy some shares of some company (q∙p) to resell them later, hopefully, at a better price (q∙p+), thus making money. Every merchant on the planet sees the same kind of problem.

The problem with trading is that one cannot make just one trade, as if by definition. Once it is done, what will you do next? One will need to do many trades over many years and keep an eye on the end result.

To make the problem more complex, you will not know for sure if the price of your selected stocks will be rising going forward. If you knew, you probably would be betting the house on every trade you made. Any player at this game realizes early that going all-in all the time is not the prudent way to play. Too much uncertainty, too much risk. It is simple: you lose it all, you are sort of out of the game. You will need to start over again with a new stake, and a new strategy, since your last one, in the end, proved disastrous.

So, most players learn to average things out (diversify) and make a lot of smaller trades (bets). They develop automated trading methods that can accumulate more profits from winning trades than losses in losing ones to produce an overall profit over the long haul simply by averaging out the risk, and uncertainty, over time. There is an equation to resume all that.

### The Portfolio Equation

If all the trading activity could be summarized in a single definitive equation, then it would be great. But, we already have such a contraption. It is old, here it is again:

F(t) = F(0)∙(1+g_bar)^t = F(0) + Σ(H∙ΔP) - Σ(Exp) = F(0) + n∙x_bar = F(0) + (n - λ)∙AW + λ∙AL

The equal sign will stand for every section of this payoff matrix equation.

It starts by saying that a portfolio's final value F(t) is equal to the initial funds F(0) operating as if invested at a rate of return of g_bar for t years. This is equal to having F(0) to which is added the result (+/-) of all the trades minus all trading expenses. Evidently. How could it be otherwise!

The payoff matrix itself Σ(H∙ΔP) could be of any size, thousands of rows (days) by hundreds of columns (stocks) and it would still resume to the penny all the trading activity ever done in that portfolio.

Furthermore, all this trading can be reduced to 2 numbers: n and x_bar. From all the trades (n), the strategy managed to generate an average net profit or loss of x_bar, including expenses. Again, hard to argue the point. The equal sign stands.

Therefore, at the end of it all, only two numbers will prevail, and this whatever your trading strategy does or that you think it can do, even if it does a million trades+. You will be subject to the number of trades the strategy made and to the average net profit per trade that it was able to achieve. Those are the important numbers of any trading strategy. They are the numbers you will end up with. Consequently, those are the numbers to be concerned about.

The last part of the equation is breaking down n∙x_bar into its components: the number of winning and losing trades. So, you have the number of losing trades (λ) times the average net loss per trade (AL). and the rest (n – λ), the number of winning trades times the average net profit per trade (AW). Nothing very complicated, almost trivial and certainly self-evident.

We have a portfolio equation to explain the outcome of any trading strategy whatever its composition and whatever its duration.

### So What!

Well, if all trading strategies end up with F(t) = F(0) + n∙x_bar, or, F(t) = F(0) + (n - λ)∙AW + λ∙AL, then those are the numbers that matter. Everything else not having an impact on these numbers might as well be considered as irrelevant or some kind of cosmetic code.

Whenever I see the outcome of a program where AW tends to AL (AW → |AL|), and many programs have this, I look at (n – λ) to see if it was worthwhile. For instance, a hit rate of 51% (n – λ)/n is not that much different than the expected outcome of flipping a fair coin, whatever predictive powers one would like to attribute to their trading program. It most certainly is not the way to show predictive powers.

If your trading program has for outcome: F(t) = F(0) + (n - λ)∙AW + λ∙AL, then those are the only numbers to worry about. Evidently, you want to make AL and λ as small as possible while having n and AW as large as you possibly can. It does translate to having a better hit rate: (n – λ)/λ than just 51%, and a better average win to average loss ratio: (n – λ)∙AW / λ∙|AL|.

Whatever the design of your trading strategy it will end up with the above equality.

Therefore, improving on a trading strategy will require code modification that can have an impact on the above equation. Any code modification or improvement will need to find ways to increase n, reduce λ, increase AW and reduce AL. Whatever you do, there is nothing else that matters if it does not have an impact on those numbers.

The equation stands, and it will stand for centuries to come. That is not an opinion. It is an old statement bearing an equal sign declaring and setting it in stone.

In the end, common sense must prevail. Should you not be interested in looking at what are the long-term consequences of your trading strategy, then don't blame anyone but yourself for not having planned that far. If in the end, you lose, it will be strictly your fault, no one else's. You had all the tools to make it good and even better than everyone else and with ease, but you failed.

The market was not against you, you simply designed your trading strategy to fail from the start, and it did. So, do not be surprised, and do not complain. You were the architect of your own demise. You do not want to plan for the above equation, it is your choice, but it won't make those numbers disappear.