January 10, 2018

Portfolio management theory has had a lot of books written about it. However, few show how easy it can be to express the outcome of a large portfolio's total trading activity using a single mathematical expression.

I use a payoff matrix for simplicity and convenience. The outcome of a payoff matrix gives the total profit or loss of a stock trading strategy: Σ( ΔP). It is a simple expression and it carries a big punch.

In Python, the code could be: (H_strat  ∙ dP).cumsum().

We can not say it is complicated. In Excel, it would be the sum of a two-column multiplication.

A portfolio "Y" will have the matrix equation:

Portfolio_Y = Init_cap_y + (H_Strat_Y    dP).cumsum() - (Exp_Y).cumsum()

A one-liner doing all the accounting, and containing the complete historical record of all executed trades. It reads as follows: the total value of portfolio "Y" is composed of its initial capital to which is added the cumulative outcome of all trades, and where all trading expenses have been subtracted.

The payoff matrix could have thousands and thousands of trades, if not millions, and still, a single line of code would take care of it all. Expressed as a vector, it would be: Σ(qΔp), where the result of the sequence of trades is added up. Both formulations give the same answer, only the packaging is different: going from vector to matrix.

The same equation will apply if you add dimensions to the matrices. The purpose is to consider more than just one portfolio or strategy. The general form would be:

Portfolio = Init_cap + (H_strat    dP).cumsum() - (Exp).cumsum()

A 3-dimensional array would tally the results of a multi-strategy portfolio. While a 4-dimensional array could keep track of all portfolios of multi-strategies for a fund.

A fund of funds of portfolios of multiple trading strategies could be expressed as a 5-dimensional array. Adding one more dimension would give the ability to monitor all funds of funds of portfolios of multiple trading strategies by country. Resulting in one really huge payoff matrix representing up to all portfolios in the world.

All of which, in a single line of code.

That your portfolio be small or the biggest there is, it is still the same equation. It is only the packaging of the recorded trading activity that is different.

But, this is trivial. It dates way back. Meaning it is not new stuff.

However, a payoff matrix can provide some needed perspective. And that is more important. It forces us to consider a portfolio, whatever its size, in its entirety, as a big block, from start to finish. With the finish, the most critical part, since it will give a portfolio's end value which is exactly what the equation provides.

We could view these matrices row by row and try to predict what the next row will be as in a period to period efficient frontier portfolio optimization process, or we could plan for the final outcome of the trading strategy since what will matter in the end will be the result of the above equation.

This end result comes after years and years of having your machine execute whatever trading program you can imagine. Note that even with a periodic rebalancing optimizer, the same equation will prevail. What you want, however, or should want, is the highest payoff matrix you, or your program, can generate.

You want your solution to have less volatility, then plan for it. Just as if you prefer low beta or low drawdown scenarios. There, you can plan, not just for the next period, and then the next as they come along, but for the entirety of a portfolio's lifespan which should be measured in decades, and not just for a few months going forward.

For example, a daily forecast for a portfolio of 200 stocks over a 20-year period would require rebalancing 5,200 times. In a minute-to-minute scenario, it would be over 2 million rebalancing periods leading to a potential 400+ million transactions, or trading decisions to be made over this 20-year timespan. So, there is a need to plan what you will be doing, and why.

It is a CAGR game, and there are few components: Init_cap, H_strat, and time. Evidently, you also need a price matrix P, but, that is supplied, and you can not change it. It is not under your control, while Init_cap, H_strat, and time are.

We need to design trading strategies that can last and not just strategies that tend to fizzle out right off the gate. The only way to do that is to plan what your trading strategy is going to do over the long term.

And when you look at your trading strategy, it should be viewed in the context that it could merit to belong to a larger portfolio of strategies. But there, it will have to answer a simple question: is this new strategy bringing something to the existing mix, or will it be a burden? Will it carry its weight?

Will it improve the overall portfolio of strategies in some way? That becomes the question.

A portfolio of strategies can only gain if the added strategy brings in some value. Since the new strategy will need to be financed using existing and available funds, based on the same initial capital, we have:

Portfolio = Init_cap + (H_strat    dP).cumsum() - (Exp).cumsum()
+ (H_strat_Y    dP).cumsum() - (Exp_Y).cumsum()
> Init_cap + (H_strat    dP).cumsum() - (Exp).cumsum()

This can only happen if:

(H_strat_Y    dP).cumsum() > (H_strat_Z    dP).cumsum()

where strategy Z (H_strat_Z) is already the best in the portfolio. All other scenarios will reduce the total outcome, will reduce the overall generated profits.

In a way saying that for a new trading strategy to have some value, it needs to outperform not only the best one you have (making it your best) but also, the best "they" may have. That is the challenge.