Basic Portfolio Math VI


Basic Portfolio Math V ended with a hint to the next step in this series. And that is giving some consideration to the "uncertainty" of market prices and what to do with it.

A trading strategy is the cumulative sum of its trading decision allocations. And when looking at a strategy's payoff matrix, all we see that can be controlled is the holding inventory matrix $\mathbf{H}$ as in: $\sum_1^n(\mathbf{H} \cdot \Delta \mathbf{P})\,$ since the price matrix itself $\,\mathbf{P}\,$ is out of our control. As a consequence, so is $\,\Delta \mathbf{P}\,$ its price difference matrix. It will be the trade decision process that will differentiate strategies. Or, the what triggers the $\mathbf{B}$uy and $\mathbf{S}$ell decision matrices: $\mathbf{H} = \mathbf{B} - \mathbf{S}.\,$ That you try to predict what is coming next or try to react to what has happened or is happening might not generate that much of a difference depending on the circumstances. However, your perception of the game might. The what you do, based on whatever, will.

It will be the actions you take that will move your stock inventory, and that is all the payoff matrix responds to: your trading decisions. We make these trading decisions, place our bets on the table $\,(q_i \cdot p_i)\,$ which can take a fraction of a second to execute. We need to determine trade triggering mechanisms and holding times which will include stopping times.

The Trading Problem

The trading problem is different from the investment problem with regards to uncertainty. The former is looking at a lot more of it than the latter. Even if at times, they are trading the same stocks. Long-term investors, by definition, have a long-term vision of things, uncertainty is of a different nature. It is still the worry of what will happen next, but it is not the worry of the immediate future, it is over the long-term prospects of the companies they invest in. Day to day price variations are of lesser concern. They want to deal with the big picture. When they look at their portfolio they speak CAGR, Sharpe ratios and performance metrics compared to benchmarks. That the price of some of their stocks went up or down a little today is of minor concern, as it should.

But, this does not mean that they are blind. Or that because their preferred holding period is long-term that they lose their sense of reality. It is that their expectations are more in terms of CAGR, long-term CAGR that is because they know that long-term, it will positively favor them.

A trade is: $\,q_i \cdot \Delta_i p.\,$ There is nothing more to it. It has for initial bet: $\,q_i \cdot p_i.\,$ The $\,\Delta_i p\,$ is what trading is all about. It is easily defined: $\,\Delta_i p = p_{out} - p_{in}.\,$ It is the same as for any merchant buying some "stuff" at $p_{in}$ to resell it at $p_{out}$. Merchants know they do not make a profit all the time. They take their chances, they play their numbers, they play their averages. They know that over the long-haul they will win most of the time, that things will average out to their expected long-term averages.

The investor is ready to wait for $\,\Delta_i p.\,$ His/her investment could be expressed as: $\,q_i \cdot p_i \cdot (1 + g_i)^t,\,$ their initial stake growing as if at rate $g_i$ per annum over many years. An investor's portfolio is composed of many such investments. We could sum them all up to give an overall picture of this long-term portfolio: $F(t) = \sum_1^i(q_i \cdot p_i \cdot (1 + \hat g_i)^t).\,$ Each stock ($i$) in the portfolio having their own initial bet and operating at their individual rate of growth. The investor should have for major concern: the stock selection process for each bet: $q_i \cdot p_i,\,$ and their respective expected growth rate: $\hat g_i$.

For instance, if I asked your advice on this, you probably would give me: "find the best companies out there and hold on". The same kind of general purpose advice you might get from Mr. Buffett.

Uncertainty for the long-term investor resides in his stock selection: $\,q_i \cdot p_i,\,$ and in its expected outcome: $\hat g_i$. All they can have on this are expectations. No probability measures, only expectations. And, only general in nature, as prospects, ifs, and maybes. Noteworthy, the expected expectation is positive for a diversified portfolio over the long term. The long-term investor is buying parts of prosperous businesses after all.

So, the notion of risk is different. The investor has diversified money on the table. All his/her investments will not go bankrupt tomorrow. They are not at risk of losing it all. They averaged out uncertainty over time and over businesses. Most of what they have to do is just monitor their holdings and wait, and wait, and waaiiit...

The Trader's Problem

The trader has quite a different problem, he will have to live in uncertainty, if not with it. To such an extent that he will not be able to make any assurances as to if the next trade will be profitable or not. Still, the mechanics of the trade are the same: $\,q_i \cdot \Delta_i p$.

In order to make a profit, either $\,q_i \cdot \Delta_i p > 0$, or $\,-q_i \cdot \Delta_i p > 0$. A profit can be had from a long or a short. There are no alternatives, except in derivatives. Evidently, you lose some if: $\,q_i \cdot \Delta_i p < 0\,$ or $\,-q_i \cdot \Delta_i p < 0$.

It is not the mechanics of the trade that is causing any problem. It is $\,\Delta_i p,\,$ since you might not know that well in advance its size or orientation.

It is the uncertainty which will cause the most problems in trying to design a worthwhile trading strategy that will not only prosper over some past trading interval but most importantly that will survive when it will be set to trade live. If it was not for this little word, we could predict, with relative accuracy what would be coming our way and really make a fortune out of it. But, it does not appear to be the case, uncertainty there is.

I do not care much about what a strategy did over some past data, all I want is to make sure that going forward the strategy's programmed "behavior" will do about the same and also outperform expected long-term market averages. If my trading strategy cannot beat an indexer over the long term, then the better course of action was to become one, an indexer that is, and not follow that strategy whatever it was.

The Certain Uncertainty

There are degrees to uncertainty which translate into ways to say "not sure" this will happen. There is little uncertainty when you can make predictions and almost all of them occur. There is a lot more of "not so sure" when the probability of occurrence is approaching one half, while still maintaining some bias (up or down). And there is this "totally not sure" thing when it does reach a 0.50 expected probability outcome.

In signal processing, dealing with limited uncertainty is resolved using filtering techniques and functions to detect the signal underneath. While in a total uncertainty scenario (50/50), whatever you do will be dealing with noise which has no inherent predictive features, except that it is noise. Market noise should be viewed as such, an expression of randomness.

The more there is randomness in a price series, the more it becomes unpredictable. If we consider the stock's price movement as a random-walk, then our trading strategies will be trading on market noise that we think or classify it that way or not. It will still be noise, on and off, with a 50/50 probability.

A price series could have for signature: $p(t) = p_0 + \sum \Delta p$, an initial price to which is added all the price variations up to its terminal time. If $\Delta p$ is random, we are facing a martingale where $\sum \Delta p \to 0$. And if random, there is no assured profit to extract from the price series.

Under such conditions, there is no money to be made except by chance, and by chance alone. But, any trading strategy lives for its payoff matrix, and if $\sum \Delta p \to 0$, then the payoff matrix itself will tend to zero. We would get: $\sum^n (\mathbf{\hat H} \cdot \Delta \mathbf{P}) \to 0\,$ as should be expected. Making it a game not worth playing except for its entertainment value. A payoff matrix tending to zero says that you should not expect to win. But, it also says you should not expect to lose either. You could just have fun playing the game and accept the consequences of being lucky or not.

It would also make designing a trading strategy almost useless since it would automate not making money when you could easily do that just by doing nothing at all. Unless, evidently, should you or your computer be lucky!

You need a bias in a price series to be able to detect something worthwhile. There is a degree of randomness in the market. If we observe market participants, especially traders since we do want to design trading strategies, we can see that most have a hard time outperforming the averages over the long term when they should do exactly that, perform as good, if not better, than their expected market averages. Over the long term, the US market has had a positive expectancy. This long-term upward bias is as if in the range of 8-10$\%$ compounded annually. If you perform less, then you are not very good at trading or investing for that matter. If you perform better than average, then you are showing skills or is it still partly luck of the draw? Up to a certain level, it might be. But beyond that level, you would have to attribute the outperformance to skills that it be discretionary or automated trading.

The Stock Trading Equation

From the portfolio payoff matrix equation, we can separate winning trades from losing ones: $$\sum^n (\mathbf{H} \cdot\Delta \mathbf{P}) - \sum^n_1 (\mathbf{E} \mathsf{xp}.) = n \cdot \bar x = (n - \lambda) \cdot \overline{AW} + \lambda \cdot \overline{AL} $$where $\overline{AW}$ represents the average net profit per winning trade, while $\overline{AL}$ stands for the average net loss per losing trade, and $\,\lambda\,$ is the number of losing trades. With it we can determine the win/loss ratio: $\displaystyle{\frac{n - \lambda}{n}}.\,$ Its range is from zero to one: $\left[0.00, \cdots, 1.00\right]$ as $\,\lambda\,$ moves from $n$ to $0$.

We know that if we reduce the number of losing trades relative to the winning ones, we are improving our total outcome, just as if we increased our profit factor: $\frac{\overline{AW}}{\overline{AL}}$. The mathematics of the game is dictating what to do, and it is not that complicated.

Is it reasonable to introduce randomness in the concept of stock price movement? Yes, for sure, even though strategy developer would prefer handling "factors", "alpha streams" and "principal components" rather than random-like data series. As if giving names to random-like series, they would stop behaving as if random-like.

In fact, there is so much randomness that it alone is sufficient to answer a lot of questions. If you design a random price series using: $p_t = p_{t-1} + \left[(\mathsf{random}()-0.5) \cdot (\mathsf{random}()-0.5) \cdot 5 \right]$, with $p_{0}= 50$. You will have a price series starting at 50, with randomly distributed price variations ranging from 0 to $\pm$5. Once charted, it will oftentimes look like a genuine price series. Every time you would request a re-calculation, you would get a new chart, none of it predictable, except for $p_{0}$, its initial price.

If you think about it, having near quasi-random price series is about the only type of price series that could satisfy a lot of theories and a lot of trading strategies. Saying that whatever you would want to extract from a randomly distributed price series you might get. That it be patterns of all types, correlations with whatever, you would be able to find them. There is no machine learning or deep learning program that could extract an assured profit from such a contraption. It could, looking at past recorded data series, but it would fall apart on any newly generated ones. No points of reference, no hidden layers, no database on what to expect, except that the next price might go up or go down by an undetermined amount.

Say you have a moving average crossover system. You should be able to visualize this one with ease, especially if you have seen or designed a few such programs on your own. The moving average crossover would trigger its trades as if randomly generated due to the very nature of the price series themselves. Sometimes it would work and sometimes it would not. There would be no guarantees, just as you would not know how the next coin flip might turn out. If it was not the case, you would have, on average, an expected positive prediction available, meaning that you would have an edge that could be exploitable.

A random-like price series is the only type of series ready to accommodate everyone since everyone will be able to find what they are looking for, whatever it is. Any trade triggering mechanism will appear, in such a series, as if randomly generated. And also, as a direct consequence of the trade triggering methodology. The profit expectations might not be there, but the trading would. And it might turn out to be on the lucky side.

One should realize the extent and implication of such statements. The more stock prices approach a random-walk the more they become unpredictable since they are approaching a 50/50 kind of game. It would be like flipping a coin to determine the outcome of the next coin toss. The expectation on such a martingale is zero. If you win, it will be by chance, not skill, since no skills could be inserted into this flipping process. It does not say that you are losing, only that you are in a 50/50 game where you can win or lose due to good or bad luck independently of your skills, whatever they may be.


Take a purely random series such as heads or tails. Whatever method of play we would want to devise, no matter how simple or complicated, no one would have the ability to overcome that game, no matter how long they tried. And people have been trying for hundreds if not thousands of years. All they could achieve when winning was winning by chance alone. Some, sometimes, fixed the odds in their favor by using biased coins or loaded dices, thereby turning the game to their advantage. But, presently, that is not the subject.

$\Delta \mathbf{P}$ is not under our control. For sure, we cannot influence the price matrix $\mathbf{P}$ in a simulation performed over past recorded data. Each price series might be unique, but each series is the same for everyone. A portfolio could be composed of any subset of the stock universe available to all. And the combinations available in this stock selection universe is humongous.

Even though the odds on a heads or tails game are 50/50 implying that there is no gain to be had: $F(t) = F_0 + \sum \epsilon = F_0$, one will rarely fall on $\sum \epsilon = 0\,$ even if it is the most expected and probable outcome. The expected $\,\bar x\,$ on such a game is zero: $\mathsf{E} \left[\bar x \right] = 0$. There is no edge available and therefore none to be had. You do not have to guess what $n$ times zero is. Nonetheless, luck can and will be at play (good or bad).

The more a game has random-like characteristics, the more the expected outcome will behave like a martingale. And the more difficult it will be to extract an edge from such a process.

But everyone knows that. And yet, few want to look at it closely. As if, if they looked too closely it would invalidate their own trading strategies, and therefore, why look? Well, they should anyway.

When you want to fool yourself into believing that your trading strategy has something and do not do proper testing, I usually find it acceptable as long as it is your own money that is on the table. It certainly indicates that you have still a few lessons to learn. Regardless, you can always make yourself believe whatever you want. However, you should draw the line when other peoples' money is on the table too. You should do your homework and validate that what you have can at least sustain the test of time.

Quasi-Randomly Trading

This point is easy to make: a quasi-random price series will accept any trade triggering mechanism and still be treated as if randomly generated or triggered. It will show to have the same effect as if it was. We already know that using a coin flip to predict a coin flip does not bring with it any advantage whatsoever. The outcome is simply the same as if doing a single coin flip. Trading in the stock market approaches this type of outlook the more the price series is random-like.

If you could predict, you would be stating that there is an edge available that can be detected, and acted upon. And the less your predictive powers are, the more the time series you are dealing with might be random-like. Indicating that your predictive powers might be an illusion.

Your trade decision process will recognize the quasi-random nature of the price series by producing a low or non-performing payoff matrix.

As a matter of fact, you could design a trading strategy that would trade following randomly generated trading decisions to get in and out where you would win. It would be sufficient to have a biased coin and play in the same direction as the bias. I have an article that describes such a system. The DEVX8 trading strategy makes that point. It trades using random-like entries and random exits. Therefore, for me, it can be done. Moreover, I am of the opinion that it can be done by anyone with relative ease.

A random-like price series is the only type of series that will challenge about any type of trading system. The more it is random-like, the more difficult it will be to extract anything from the series except by chance, by coincidence. Something "by chance" is not predicting, it is just luck with another name which might or might not be there the next time around.

However, if you do have the ability to extract an edge, then it should show in your simulations. Getting only average long-term performance is not an indication of added skills or added alpha. On the contrary, it only shows that there were none. You have to do better than average to claim that skills were somehow at play in your trading strategy, that it be automated or on a discretionary basis.

$©$ July 2018 Guy R. Fleury