Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
The Payoff Matrix

The Payoff Matrix

This notebook is full of matrix formulas. You don't need math to understand the message. For me, putting an equal sign on something is a big statement. All one can do after is declare: not equal, and show why. It is not a matter of opinion anymore, it is a matter of proof.

The file looks at the trading problem from a payoff matrix perspective, which in itself can represent any trading strategy whatsoever. It concludes with any trading strategy could also be expressed as: the number of trades times the average profit per trade, leaving only two variables to consider when designing trading strategies.

It converts the search for trading profits to a statistical search of price differentials, how to detect them to then try to capture part of those moves. What you want, over the long term, is to average it all out as cash in your portfolio, and not in someone else's.

Read it. You should end with: WHAT?

Use the cloned notebook, it is better formatted.

If you have some trouble with those files. Here is the HTML formatted document.

http://alphapowertrading.com/images/divers/Payoff_Matrix.html

36 responses

The Game Inside

Designing trading programs implies mathematical formulas. We all have a vision of what our trading programs should do. Presented in this notebook, as in the prior one (Payoff Matrix) are building blocks for what I want to do with Quantopian. As if putting on paper, preparing an overall plan on how I want to use its facilities. The process could help others.

The first step is to design and structure this plan, to be followed later, by learning what is needed to do the job. Already I know the tools are there. But, I do have to learn the programming language anew and adapt my preferred programs and trading methods.

What follows in this HTML file is a description of the math involved in this process:

http://alphapowertrading.com/images/divers/The_Game_Inside.html

Use the cloned notebook, or the HTML file, they are better formatted.

Strategy Design Defects

This article examines stock trading strategies with structural defects. Meaning strategies designed to fail, even before they start trading. It is not because someone has designed a stock trading program that it will make money. You need more than that. One thing is sure, might as well learn not to include in your own programs trading procedures that are almost assured to obliterate your long term portfolio performance. But then, anyone can design their trading strategies the way they want.

HTML file: http://alphapowertrading.com/images/divers/Strategy_Design_Defects.html

This is the third part of a series, see the other two above:

The Payoff Matrix
The Game Inside

Strategy Enhancers

The following article is part of a series. It deals with ways to enhance a stock trading strategy by incrementally increasing the number of trades to be executed over a long term trading interval as well as increasing the average profit per trade. Thereby, giving a higher performance at the portfolio level.

HTML file: http://alphapowertrading.com/images/divers/Strategy_Enhancers.html

To gain a better understanding of this article, see the following notebooks above:

The Payoff Matrix

The Game Inside

Strategy Design Defects

Total agreement - kudos to you. We put slightly differently but end result same.

See our paper:

Steiner Integrability for Simply Prime, Artinian,
Uncountable Classes

Assume ~ J 6= 0 . In effect, the main result was the classi cation of
contra- Grassmann, canonical planes. We show that there exists a
characteristic, almost surely Taylor and holomorphic natural random
variable. Recent developments in advanced statistical potential theory
have raised the question of whether every quasi-arithmetic
manifold is ultra-complete and quasi-hyperbolic. Therefore in future
work, we plan to address questions of stability as well as smoothness.

Conclusion
Every student is aware that ;r 6= k!0k. The goal of the present article is to
construct homeomorphisms. It has long been known that 0 is not invariant
under w [6]. Unfortunately, we cannot assume that 00 = 00. Every student is
aware that every domain is open.
Conjecture 7.1. Let us suppose Milnor's criterion applies. Let y < kjk be
arbitrary. Then every Jacobi vector is quasi-Milnor.
A central problem in advanced Galois theory is the characterization of canonically
Littlewood, multiplicative matrices. This reduces the results of [27, 32, 28]
to an approximation argument. In [11, 29], it is shown that j is complex and
super-degenerate. This reduces the results of [24] to the general theory. Therefore
it has long been known that every contra-Perelman functor is anti-natural
[1]. Conjecture 7.2. Let kPk < Gz be arbitrary. Let 􀀀  ;. Then  ;r
= Mn.
We wish to extend the results of [1] to non-unconditionally Selberg graphs.
This reduces the results of [17] to a recent result of Li [10]. This reduces the
results of [21] to a standard argument. In [13], the main result was the classi
cation of solvable, simply positive groups. A central problem in non-linear
operator theory is the construction of pointwise orthogonal, measurable, canonical
functions. B. Maruyama's characterization of meager probability spaces was
a milestone in formal potential theory. Unfortunately, we cannot assume that
f  e.

Trade Detection

What I see most often are stock trading strategies that operate on the premise of finding some kind of anomaly or pattern that the developer hopes will repeat in the future. He tries to select the best methods he has to do the job. But, it still is limiting in the sense that one is not looking to increase the number of trades but simply to accept the strategy's generated number of trades. As if looking only at one way to increase end results. It's okay, but one should want more, and could do more.

The purpose of designing a trading strategy is to have it go live once it has passed all the tests. Not just that the program is debugged, does not crash, or does not run wild. There are other tests to be conducted before releasing a trading strategy. Still, the ultimate purpose is to have it run live, to let it trade as programmed.

To make you the profits anticipated, according to your backtests, a trading strategy should behave about the same as it did on past data. You know that your trading strategy will be faced with totally unseen price data, and will react as instructed.

However, if the program has flaws in its design, non-validated premises, or even a misunderstanding of the game at hand; a live program might not do what its author thought it should do, and not respond as expected, but would nonetheless respond as programmed.

Whatever, in the end, it will be your program. So, why not make it a good one?

Anything you put in a strategy that does not resemble reality will find its way back to haunt you, and most probably, hurt you financially. You should not be surprised if reality has its own path and will continue its course in spite of what you think it should be or should do.

Double check those trading procedures, understand what they do, their side effects and interrelationships with other procedures within your program. How will these trading procedures evolve in time? They might be fix, they are code after all, but their impact will change as the portfolio grows. So, your methods, procedures should adapt there too.

The money your program will make is not just a fluke. You will have worked for it, you will have earned it, every penny of it.

The following article is part of my research notes leading to transforming some of my preferred trading strategy designs to the minute level. My current strategies are EOD (end of day). This will be a major transformation, but also, what I see as an opportunity to increase overall performance.

I anticipate being able to reduce the average holding time per trade. It will give the ability to trade more. And in a payoff matrix, as was shown in this series of articles, it counts. There are mathematical formulas, however, the context explains what they stand for.

There is one statement in the attached notebook I find important. See what it implies. It needed a context to put it in perspective.

HTML file: http://alphapowertrading.com/images/divers/Trade_Detection.html

Stock Trading Decisions

The attached notebook deals with the perception of trading decisions within the context of building a long term stock portfolio. It is the continuation of a series of articles dealing with the underlying math behind a stock trading strategy.

Instead of looking for a trading strategy that tries to shift its portfolio weighs from period to period as in a Markowitz or Sharpe rebalancing scenario, the search is for long term repeatable procedures that can affect a portfolio's payoff matrix over its entire multi-period multi-asset trading interval. The main interest is not on a trade here and there, but on the possible thousands and thousands of trades over a portfolio's lifespan. All influenced by the trading functions put on the table.

The notebook highlights the output of a trading strategy, and what should be done to improve upon it. It can be resumed in two charts:

1: Average Win Distribution

http://alphapowertrading.com/images/divers/AverageWinDistribution.png

2: Average Loss Distribution

http://alphapowertrading.com/images/divers/AverageLossDistribution.png

A trading strategy should have for objective to shift to the right the average profit per trade. Doing so will improve overall performance.

These notebooks are a lot more for my benefit than anything else. They serve as preparation to my game plan, to gain a better understanding of what I need to do. I don't want to just convert some of my existing trading strategies from one language to another. I want to do more, produce better overall programs and trading strategies. To go beyond what I have done before. Hope it can help others design their own better strategies based on these observations.

HTML file: http://alphapowertrading.com/images/divers/Trade_Decision_Process.html

Prediction Dilemma

This notebook tries to elaborate on the predictability, not of stock price movements, but mostly on portfolio performance outcomes. It tries to do this using only two numbers, one of which is just a trade counter.

The objective being to show that those two numbers which characterize a trading strategy can add some understanding of a strategy's long term goals. As if giving the ability to make napkin estimates of where a portfolio might be some 20+ years down the line, thereby providing a reasonable guesstimate.

This document is again offered in HTML due to the math formulas, in case. One does not need the math to understand the message.

HTML file: http://alphapowertrading.com/images/divers/Prediction_Dilemma.html

Extracting Tradable Information

This notebook elaborates on trading methodology infrastructure. It is part of the background information needed to go forward. It uses a MACD trading strategy as example to set mathematical structure to trading procedures. It could have used something else, the whole point is not on the MACD, but trading strategies in general.

It is a transition file, needed to understand what is coming.

The next one: A Portfolio's Core Position will elaborate on the premises presented in the present notebook, and will try to show that there are things a trader can control. The notebook after that might end the series with a bang. A conclusion that should give any developer more than food for thought since it provides an equation that could help improve about any trading strategy.

The premise being that if you can express mathematically the outcome of an automated stock trading strategy using its metrics, then you know on what to concentrate your efforts to improve its design. Hope some will find it helpful.

Again, the document is offered in HTML due to the equations. I found it easier to do it this way. However, no one needs the math to understand the message. It is only used to emphasize the points presented. An equal sign is a tough argument to break, it certainly is not an opinion.

HTML file: http://alphapowertrading.com/images/divers/Extracting_Tradable_Information.html

Portfolio Core Position

This notebook shows what I consider the core of a trading strategy. Looks at the trading problem from a different angle than most. Starting from the end results metrics, going back to design strategies that will affect these metrics over the entire trading interval. As if designing a strategy backwards, but most certainly constructively, allowing for a multi-asset, multi-period view of the stock portfolio management problem.

It also says that any trading strategy can be viewed with either 2 or 3 variables. And that they are sufficient to explain the output, the performance results of any strategy. And if such is the case, then that is all that is important. It is then our task to make these 2 or 3 variables do what we want them to do.

HTML file: http://alphapowertrading.com/images/divers/Portfolio_Core_Position.html

Your work is FANTASTIC! I have a few words to add:

It has long been known that the Riemann hypothesis holds [16]. We wish
to extend the results of [34, 1] to uncountable homomorphisms. Next, it
is not yet known whether there exists a real finite arrow equipped with a
conditionally smooth subalgebra, although [34] does address the issue of
degeneracy.
A. Leibniz’s classification of pseudo-Eratosthenes subgroups was a milestone
in operator theory. Recently, there has been much interest in the
classification of elliptic, conditionally left-solvable, Z-Gaussian lines. A useful
survey of the subject can be found in [16]. Therefore this reduces the
results of [10] to an approximation argument. This could shed important
light on a conjecture of Poincar´e. In [31], the main result was the derivation
of countably integral, open, co-combinatorially sub-Hamilton classes. It has
long been known that W ≤ 0 .

A Tradable Plan Part I

This notebook is another step in this series. Refer to preceding notebooks starting with the Payoff Matrix to gain a better understanding of what is being put forward in this two part installment.

Any automated stock trading strategy can be resumed by 3 of its performance metrics. Namely, the number of trades, average bet size, and net profit margin per trade (n, u, PT). Everything else is of lesser consequence, part of features, preferences, or descriptive properties.

If those 3 numbers totally explain a strategy's final result, then that is where one should put his/her efforts when designing, or modifying a trading strategy.

One only needs to concentrate on how can a strategy make more trades, increase its trading unit size, and increase the average profit margin. Not just on one trade, but on the thousands and thousands of trades an automated trading program can make over its lifetime.

This can be done using a variety of approaches and trading techniques. Or, one could transform, modify existing strategies with for sole intent to increase any of those 3 numbers, or all three, thereby increasing overall return. Three numbers, two of which, you set yourself.

The following HTML file is more explicit:

HTML file: http://alphapowertrading.com/images/divers/A_Tradable_Plan_Part_I.html

A Tradable Plan – Part II

This notebook is the conclusion to Part I above. Hope it is helpful.

HTML file: http://alphapowertrading.com/images/divers/A_Tradable_Plan_Part_II.html

The Deviation X Strategy

All the preceding notebooks were in preparation for what I want to do using Quantopian. My objective is to convert an existing program to the Quantopian world and improve on it. I think it can perform even better due to being able to shorten the average trade interval. This would have for effect to increase trading and to accelerate the impact of the internal positive feedback loop in those trading procedures, thereby raising performance levels. The strategy (DEVX8) has excellent metrics for an EOD trading system, at least, I like the way it behaves.

Hope some see some benefit in it, or some ideas that might help them do even better on their own. I know I can using Quantopian to do better, and as a preview simply look at this 3-part article that was also chronicled here.

A Simple Stock Trading Strategy: Part I, Part II, and Part III

The following article does give an overview of what DEVX8 does: The Deviation X Strategy.

To wet your appetite, I will focus on trading strategy scalability.

From a previous notebook, a portfolio had for equation: A(t) = A(0) + n*u*PT. Therefore, to up the ante and scale the strategy up, I could simply double the trade unit, double the initial capital, and obtain double the results, as in: 2*A(t) = 2*A(0) + n*2*u*PT. So, here are the first and last price chart of that article.

ABT following: A(t) = A(0) + n*u*PT.
http://alphapowertrading.com/images/DEVX/ABT_DEVX8_Nov12_10k.png

ABT following: 2*A(t) = 2*A(0) + n*2*u*PT.
http://alphapowertrading.com/images/DEVX/ABT_DEVX8_Nov12_20k.png

What this illustrate is that scalability might be the easiest problem to solve since all you need to do is throw more money at it.

Anyway, my mathematical backdrop is complete, now time to program the whole thing using Python.

Controlling a Stock Trading Strategy

This next article goes beyond what we usually see in stock portfolio management.

A request for more profits is made to a trading strategy by changing 3 of its parameter settings which have nothing to do with lookback periods, or indicators. They control trade aggressiveness, by that is meant the how the strategy should behave going forward. The objective is to control the trading activity, mostly by increasing it since the portfolio equation can be stated as: A(t) = A(0) + n*u*PT. And increasing either of the 3 numbers, n, u, or PT, one can increase his/her portfolio performance, even above what they could already do.

How just slightly changing 3 numbers can substantially change a portfolio's performance level simply by making the demand for more profits. A must read for anyone here. It can only bring you new ideas and show it can be done.

Controlling a Stock Trading Strategy

For a preview, here is the difference table showing the impact over this 20.71 year simulation. It shows that changing those 3 numbers added $ 145 million in profits and the article explains why.

DEVX8 – Nov. 14 2016 Differences
http://alphapowertrading.com/images/DEVX/DEVX8_Nov_14_Summary_stats_Diff.png

Hope it gives you new ideas, new avenues to explore.

A Buy & Weak Hold

The previous post: Controlling a Stock Trading Strategy was to show you could control a trading strategy to do more than it had before by using mathematical functions that could impact its 3 most important portfolio metrics: n, u, and PT, namely the number of trades, the trading unit used, and the profit margin.

To show you could do more, a base for comparison was provided in the post: The Deviation X Strategy. With this, I will be able to compare the portfolio output under the same testing conditions using the same trading strategy over the same trading interval. I found it more important to see how one can take an existing trading strategy and push it to do more. A backtest is a demonstration that it can or that it can not be done. Evidently, this articles goes for it can be done.

But whatever, a simulation won't change that there are only three portfolio metrics of importance, and if you don't improve on them you will stay with what your trading strategy gives and go no further. And that in itself can be limiting.

The Deviation X Strategy in its own right had impressive performance levels. Nonetheless, slightly changing 3 of its controlling functions saw its portfolio rise by more than $145 million in added profits with no real negatives to the system since it generated better metrics in all the departments that count. Therefore, one would have to conclude that the increased numbers were the reason for the rise in profits, since nothing else was changed.

Controlling a Stock Trading Strategy also ended with: you could do more since cash reserves which were supposed to be used more, and were, still went up by a substantial amount indicating that there was more room, more than enough reserves available to do much more. As if the step taken wasn't the limit but just a step in the positive direction.

This 3rd test is being done under the same conditions as the other two: same stocks, same trading strategy, same trading interval of 5,387 trading days (this time plus 2 days), same initial capital, same trading unit, and same random-like trading. It will also be run once as in the other two tests. Whatever the output, that is what will be reported. The objective is to show that not only can we increase profits, it can all be done with ease.

Trading will be more aggressive, increasingly taking more trades as equity rises, and selling more as the ongoing inventory increases. As previously noted: the main objective remains the same, and that is to acquire and accumulate more shares, it is the primary task of the DEVX8 program.

To save everyone's time, instead of going little step by little step as in Controlling a Stock Trading Strategy, I opted to simply jump to a higher setting, not pushing the machine to its limits, but just a straight jump to a higher level of acquisition, since that is the main driver of the strategy: to build a long term portfolio. Therefore, it should accumulate more shares along the way.

When I look at the internals of this program, I see a variation of the Buy & Hold theme. It stands ready to wait for a long time for its profit. But, if it did only that, it could only expect to reach about the same average performance return as the average.

You want more. So, you change the theme itself to: Buy & Weak Hold, meaning by this that for a price you “consent” to sell some of your profitable positions knowing that most often you will be able to replace them later at a better price.

The New Test

For this test, I changed 4 of the 9 settings. The same 3 as in the previous test which now will be raised to 40 from 30, and a 4th giving it a minor nudge going from 95 to 98. The first three settings have the same mission to increase trading activity. Raising their value to 40 is a demand, a request to do more, and accumulate more shares in the process. The forth one is making a request to try to generate more profits over the whole process. To do so, it can raise PT as well as have an impact on n, and thereby increase the ability to acquire even more shares. Therefore, I should see the inventory rise due to the acquisition of more shares than in the previous tests and see profits rise due to the increased trading activity. Trades can only be executed if there is cash in the account.

The strategy will attempt to accumulate more cash in order to take advantage of more trading opportunities available within the allowed trading windows. Not only that, but by raising PT, even just a little, it will impact all n trades taken since the profit formula is: n*u*PT.

First, let's see how ABT did on this new test.

1 ABT - November 16th test with controls: 40, 98, 80, 40, 40, 40
http://alphapowertrading.com/images/DEVX/ABT_DEVX8_N16_97.png

The ABT chart looks about the same as in the previous tests; except for the numbers, order placement, and quantity traded. Compared to the first test in: The Deviation X Strategy, ABT added $ 57.2 million in profits raising its total to: $ 98.7 million. To do this, it traded more, doing 10,440 trades of which 4,590 were closed generating $ 69.9 million in profits. During the process, it added 1,484,650 shares to bring its total to 2,193,935 shares in inventory. Still had $ 11.9 million in its cash reserves. ABT increased its 20.72 year CAGR to 29.09%. The only number that came down was the percent of winning trades which was slightly reduced by 1.59% to 86.32%, and this reduction is not significant enough to matter.

We wanted ABT to do more, and it managed to come out ahead, traded more, accumulated more shares, and even accumulating more cash in the process.

Here are the test results for the group:
2 DEVX8 – Nov. 16 2016 with controls: 40, 98, 80, 40, 40, 40
http://alphapowertrading.com/images/DEVX/DEVX8_Nov_16_Summary_stats.png

The story for ABT is about the same for all the other stocks in the portfolio. They all traded more, accumulated more shares and more cash, they all increased their long term CAGR as well, raising their profit margins and cash reserves. Actually, they all outperformed ABT. In all, the strategy executed 99,058 trades with an impressive 91.44% average winning trades.

Total, compared to the first test, the portfolio added $ 996,828,862 in value to its original return of: $ 661,918,539 bringing it to a grand total of: $ 1,658,747,401. Now that is added performance for changing just 4 numbers!

In its share accumulation program, it acquire 7,043,896 shares valued at $ 664,389,306.

The portfolio under the (40, 98, 80, 40, 40, 40) control setting had for mission to increase n and PT in the portfolio equation: A(t) = A(0) + n*u*PT. And, I have to say, it succeeded.

Just as in the previous article: Controlling a Stock Trading Strategy, here is the difference table comparing this Nov. 16th test to the Nov. 12th test (Deviation X Strategy).

3 DEVX8 – Nov. 16th test compared to Nov. 12th
http://alphapowertrading.com/images/DEVX/DEVX8_Nov_16_Summary_stats_Diff_Nov12.png

This new test with its higher settings manage to add 5.73% in long term CAGR getting it up to an average 32.33%. The price to pay to execute all this appears to be the small reduction in the percent of winning trades which decreased by an average of -1.13% to 91.44%. The strategy did not break down, on the contrary, it thrived, and appear to be ready to do even more if requested.

The rest of this article appears HERE, with the 9 other stock charts which can serve as verification for the numbers presented in chart # 2.

Boost Your Stock Trading Performance

My series of notebooks started with setting up the mathematical backdrop to a stock trading methodology made to last. Putting a stock portfolio payoff matrix at the center of it all as the bean counter for any trading strategy: A(t) = A(0) + Σ(H.*ΔP). This time function was then reduced to: A(t) = A(0) + n * u * PT.

Three numbers of interest: number of trades done, trading unit used, and average profit percent for trade. Three portfolio metrics given by any simulated, or live, stock trading portfolio whatever its composition. One could view n * u * PT as a trading strategy's signature.

Arguments were put forward that a trading strategy designer's job was to find ways to increase the output of: n * u * PT, since that is where trading profits came from. They were the only metrics that affected the total outcome of a trading strategy. There was time involved in the process, but at bean counting time, what mattered was: A(t) = A(0) + n * u * PT. On the right hand side of the equal sign you only had numbers, and for unit, a dollar sign.

Were brought forward enhancer functions which were resumed in: A(t) = A(0) + (1+g(t)) * n * u * PT. Evidently, with g(t) > 0, portfolio profits will get larger. But, if we went a little further, and put on the table: A(t) = A(0) + (1+g(t))^t * n * u * PT, you would go much faster by introducing a time compounding function. It is a major distinction, in fact, a game changer. It is like putting your existing trading strategy on steroids.

Since n, the number of trades could make such a difference in a portfolio's performance, it was suggested to find ways to increase it as much as one could, this on the premise that a trading strategy already had PT > 0, meaning it had a profitable edge.

In Prediction Dilemma it was said that prediction is not that easy to achieve over the short term where a trader intends to play. Short term, randomness in stock price variations is rather high, so high in fact that most have a hard time escaping the randomness of the draw.

There was also this dilemma: whatever predictive tool you might have developed over past data might not be that predictive going forward. As if whatever you did as predictive simulation would be almost irrelevant since the future might not adhere to, or acknowledge, your view of the statistical world you built in your trading model. Or, if you could predict some price variations, the average spread might be insufficient to cover frictional costs.

It is not because you have some statistics on past data that they necessarily become probabilities on the future. And, if your statistics show close to randomness, then you might be just making quasi-random bets, gambling your way out, thinking you have a predictive system.

The stock market is complex, not simple. Sure, prices have only two ways to go: up or down. So, you can say: probability for going up is close to 50%, but is it really? The closer you get to the 50/50 state, the more winning a bet will be due entirely to chance, and your game will just have been converted to a gambling proposition. Not investing, not trading, but simply gambling with all that it implies. And in such circumstances, maybe a fancy theory on how the market works and your declared ability to predict short term price movements might be, may we say in need of a reality check.

The first consequence of putting the market in a 50/50 proposition is not knowing if you will end up winning the game at all, and that one is a bummer. You will have reduced your future to the equivalent of a single flip of a coin. Has anyone noticed that there are no individual short term traders that have lasted for decades?

It was then proposed to extract tradable information from all the available data with an eye on n since it counted so much in the final output of a trading strategy.

All this was pretty basic, and with this foundation it was time to start building a trading plan where n, u and PT would be the center of attraction. Everything you could program your trading strategy to do would be reflected in those 3 numbers. It didn't say which method to use, as if saying anything you want, it only said that the only 3 portfolio metrics of importance were: n, u and PT.

In Controlling a Stock Trading Strategy, it was shown how these principles could be applied to a trading strategy. I used DEVX8 for illustrative purposes, but it could have been done with other trading strategies as well. For instance, another example is: A Simple Stock Trading Strategy. You will find a dozen more on my website showing different ways to sliced and dice n, u and PT.

In the presented scenarios, emphasis was put on controllability. As if saying you want more, then go out there and get more. Turn on the volume.

It was shown that small additions to enhancer functions would generate higher portfolio returns from the same trading strategy. Not a line of code changed, and yet, performance would increase due to these portfolio metrics being asked to do more. It was more like ordered to do more.

This is a major departure from a trading philosophy adopting a kind of Markowitz view of the market always rebalancing portfolio weights from period to period.

Here is proposed that one should look at his/her trading strategy not just from period to period, but as a whole over the entire duration or life of a portfolio. Not counting on tomorrow I rebalance, but, on a long term vision of where you want to go, as if a trade was just part of a much larger long term plan.

This point of view would be of interest only if it could provide a higher performance level than under a Markowitz trading environment.

In my last post: A Buy & Weak Hold, was shown that you can push on your machine with no real or significant detrimental side effects. In a way showing you could easily exceed traditional trading methods.

Enhancer functions were applied to a trading strategy. Changing the value of 4 numbers that had everything to do with the demands you made on a trading system. They were not wishes, or better predictive methods, or better trading setups, or a better use of indicators, or changes is lookback periods. They were explicit demands to do more, to increase trading activity and accumulate more shares over the long run.

Simple bean counting measures, administrative procedures directing and funnelling the outcome of a trading strategy to its goal of building a long term portfolio.

And yet, apparently, almost no one shows any interest in what could be quite a different approach from traditional trading methods. This is not a crackpot's perspective, but trading rules that can be implemented by anyone, even without the help of a machine.

These simulations only serving to say that there is something there worth more than just a glance. Especially, if it is based on such an elaborate mathematical backdrop. As said elsewhere: an equal sign is a powerful statement. Also, a simple observation, if there was nothing there, then the simulations would have shown it. They usually are without mercy on such things.

To make the point even more compelling, the program used was a year old, operated as if randomly trading with random-like entries and random-like exits using market order for the next day at the open. Those are really adverse conditions to make a buck.

No matter how we look at the market game, it remains a CAGR game and it is our job to design the best trading strategies we can. But that does not mean that we will be able to escape the math of the game.

In: A Buy & Weak Hold, you can see how just by changing 4 numbers, (4 constants by the way), starting with a $ 5 million stock portfolio, the strategy ended with $ 1.6 billion, managing a 32.33% average CAGR over its 20.7 year testing interval, doing 99,058 trades, and still managing to end with 60% of its equity in cash.

The same trading strategy was used for all 3 tests. No code logic changed, not a single line, no optimized or fitted data in any way. Each of the 3 tests were ran once with their respective settings to show the progression it could make. Using intermediate values would have generated intermediate results. Pushing for more would have resulted in still more.

This was taking what I view as a generic trading strategy and making it do more, trading the same way as it did before, but requesting an increase in trading activity. This was not done by increasing the bet size since it remained the same in all 3 tests. It was done by requesting an increase in the number of trades and an increase in the profit margin.

The outcome was to change the portfolio equation from: A(t) = A(0) + n * u * PT into a more elaborate self-engineered alpha generator: A(t) = A(0) + (1+g(t))^t * n * u * PT.

If your trading strategy already does better than what was presented in: A Buy & Weak Hold, then, congratulation. Nonetheless, you might find that you could do even more using some of the proposed techniques. If your trading strategy does not do better, well, maybe looking at the presented principles might help you boost your performance level too.

The WOW Factor

I will start with the conclusion since it is intended to raise eyebrows and it can be given in one screenshot:

1 Example Momentum - WOW

http://alphapowertrading.com/images/divers/SampleMomentum_Mods_v01.png

The above chart comes from modifications to the program found in the Quantopian Lecture 43: Example Momentum Algorithm. To achieve such results, I modified parts of the code that dealt with n, u and PT since they are the only portfolio metrics of significance.

Note that the above chart is just an exploration of possibilities. As is, it would require a lot of guts to put it in operation. For those afraid of the max drawdown, that can easily be solved by adding $ 9 million to the initial capital and not using it.

To increase performance, I increased n considerably since it is the easiest to do, and will have a major impact on the payoff: (1+a) * n * u * PT. Then added some leverage since that too has an impact: (1+lev) * (1+a) * n * u * PT. When using leverage, what you want is to generate a higher rate of return than the cost of the leveraging which in this case is more than covered. Also increased the trading opportunities available by rebalancing 3 times a month instead of only once. This has for impact to reduce the trading interval and also detect more trade candidates. The trading strategy itself, its logic, was not changed. Mostly just changed numbers here and there.

The original version of the program produced the following chart:

2 Sample Momentum – Original Version

http://alphapowertrading.com/images/divers/SampleMomentum_original_version.png

There are what I consider flaws in this design. I used a bulldozer to massacre the code. But maybe most importantly, I changed what the trading strategy should do by giving it a longer term vision than just rebalancing from one period to the next.

I wanted to answer one question: how far can it go? Based on chart #1, it is pretty far, and it is still not the limit. Mind you, I would not trade like this either. I would repair what I consider as design flaws first, and would also add procedures to reduce its volatility. Nonetheless, it is a good indication that one can put the pedal to the metal so to speak.

For the less adventurous, maybe a more mundane set of modifications might be suitable. Chart #3 is the result of slightly broadening the selection process, pushing leverage to 1.5, and adding a mid-month rebalancing made to increase trading opportunities.

3 Sample Momentum – Partial Modifications

http://alphapowertrading.com/images/divers/SampleMomentum_Mods_partial.png

When designing a trading strategy, one should have a long term vision of what that trading strategy can or might do. Going from period to period à la Markowitz, or à la Sharpe ratio rebalancing, might not be enough, when one could do so much more.

Ah yes, the total return on chart #1 translates to $ 22 billion. One should consider putting $10 million instead of only one, while still only using one. It would reduce volatility. Maybe what chart #1 says is: find the limits of your trading strategy. It is a lot easier to reduce your trading strategy to your comfort zone than to raise it.

The WOW Factor – Added Notes

In my previous post (see above), it was said I would not trade in that fashion. For one, I do not have that kind of capital available. And two, I may be too chicken. I prefer a smoother ride. But, that does not mean that this particular trading strategy is wrong, or that we can not extract useful trading procedures from it. Even downplayed the strategy could make quite an impact.

The strategy did give more than an indication of where upper trading limits might reside. And based on the strategy's code, it could do even more. I was exploring to find where these limits were, and even at the presented level, the program had not reached them yet.

For your convenience, here is chart #1 again:
1 Example Momentum - WOW
http://alphapowertrading.com/images/divers/SampleMomentum_Mods_v01.png

What the chart does give is this: you can push an ordinary trading strategy to a much higher performance level simply by making changes to trading procedures having an impact on: n*u*PT. The rest seams secondary, meaning, the how you do it is opened to about any method you might like. All you want is to have those trading procedures have a net positive impact.

Sometimes, you have to go further than everyone else, even if in doing so, you are alone. And it is not because you think differently that you are necessarily wrong. It might just be that you have a different way of doing things.

From the previous post, the question should have been: is the simulation that generated chart #1 possible? The answer to that is: yes, as evidenced by the chart.

As said before, I would not trade exactly like that without correcting some of the strategy's flaws (at least what I consider as flaws). It is nonetheless a feasible trading strategy as is, even with all the wasted resources and shortcomings. This trading strategy trades that it likes it or not. It just trades, for no other particular reason than the price changed between rebalancing periods.

The strategy might start trading 7 stocks on its first trading day, but gradually, it will trade more and more, to the point that at the end it is taking over 30,000 trades each day it rebalances. There is nothing wrong with that, a machine is doing the work, and since the profits are there, why not take them. After all, the strategy is only doing what it is programmed to do.

It is to show that if I push hard on “n”, the number of trades, a part of the major portfolio metrics of significance: A(t) = A(0) + (1+lev)*(1+a)*n*u*PT (see previous article). I can increase profits considerably by also raising “a” and leveraging it right up to a WOW level.

Chart #1 remains a viable trading strategy. It is very erratic with wide day to day variations, and might require nerves of steel as can be seen in the volatility and beta numbers. The program seeks volatility and this can have quite an impact on u*PT.

Some might say: you did not account for commissions and slippage. Yes, they were accounted for. The program used the default Quantopian setting which already accounts for them. So, what you see on chart #1 does include frictional costs. Even so, they would add up to less than $10 million over the trading interval. Go ahead, double it, triple it, put it at $100 million if you want. It does not make a notable difference on the final result. One could see those frictional costs at most as a trivial consideration.

What I see in this trading strategy is just a different way, a different set of trading procedures, than what I usually use to push n*u*PT higher. As such, it adds to my arsenal of available trading techniques. It now becomes available should I need a marked down version of it.

The only thing not seen in the presented simulation is the interest charges related to the leveraging since the strategy does use leveraging. But there, whatever those charges might be, they would be more than compensated for by the excessively high return which would have taken a $10 million dollar account to a $ 22 billion profit.

🌋

💣💣💥💥💥😀😀😀

Luke, I understand your point of view. I have the same questions all the time: is it feasible, can it work, will it sustain itself, will it blow up, are there any bugs in the program, how about logical or unexpected bugs, is there a bias in the stock selection process, is there unintentional peeking ahead, is the data okay, and on and on.

Like I said, I would not trade according to that chart without correcting what I consider as design flaws. What was presented was just an exploration phase of a design, a look at the possibilities, looking for the limits. And on a first look, I don't mind seeing a chart like the one presented. I see it only as an idea of where I might find some of those limits. The strategy then goes to the next design phase where I will try to eliminate whatever I didn't like without using over-fitting procedures. I might even end up with a totally different design. But, it does not mean that all that is in that strategy is no good. Only that some of that stuff needs to be corrected, whatever the undesirable behavior may be.

Just like you, I did not like the big drops. But that can be alleviated considerably without changing the underlying trading methodology which by itself show promise. I used a bulldozer in that design, without any finesse whatsoever. So, I am not disappointment by what came out. It only said I have more work to do to bring it down to my comfort zone, and I do have ways of doing that.

I don't use trading methods as usually used in the strategies I see on Quantopian. I go for building a portfolio over time: that is accumulating shares for the long term while trading over the process. It makes it a quite different kind of trading strategy. So the big numbers you see have two parts, a trading process used to generate profits which are reinvested in acquiring additional shares. This profit reinvestment creates a positive feedback loop which becomes the reason why the portfolio's equity grows in time.

The strategy is building a portfolio of shares, and whatever it will be holding with fluctuate in sync with the market. There is nothing mysterious in what is presented. However, I am not yet in the habit of providing my code for public consumption. That might come to change, but for now, I don't want anyone to get harmed by what I consider an unfinished program that is still in the exploratory stage.

It is also why I only provided the mathematical background to a methodology since I do think one could convert their own trading strategy to one that also accumulate shares over the long term. And since no one has disproved any of the equations provided, not even Anthony, I stand by them. So, technically, you, and others, have an invitation to show that the equal sign used in my demonstration is not valid. Only then, you could have my “house of cards” crumble and show it is all BS. An equal sign is a powerful statement, it certainly is not just an opinion.

On the other hand, it might be an invitation for you to look more closely at what is really proposed in that portfolio building, not just the trading aspect, but also the long term share accumulation process.

I know when I will start putting restrictions on that strategy, the return will drop somewhat. I don't know by how much. But, it will drastically reduce the drawdowns as I've done in other programs. However, I will have to wait and see what those modifications will be. But for sure, there will be drawdowns for the simple fact that part of the portfolio will be in stocks, not only part of the time, but almost all of the time. That is no different from any long term holder.

However, except for the drawdowns, there is nothing wrong with the methodology itself. Look at other charts I've presented which operate under the same principles that show more subdued results even if they too could also be considered high.

As said before, it is not because you do it differently that it is necessarily wrong. There is no attempt at deception in what I presented. Only a different method of doing things. It might appeal to some, and others not. When I will be better versed in Python, I know I will be able to better control my trading strategies.

Thanks for bringing it up, I'm sure others had the same point of view but couldn't find words to say so.

Ok, so I see now too late what I walked into, I was annoyed by some other thing and stepped on a land mine.

The math is out of my depth but I would suggest looking at your assumptions before worrying about math equations. In my experience algo trading is a lot like starting a business - the hardest part is the execution. Math equations that can extract value from the market are a dime a dozen but you would be hard pressed to find someone successfully running one live. Is one of your assumptions that the very thing you have to do to make it trade-able won't also render it useless? It's happened to me before.

Luke, why should it be a minefield? All I presented is something a little different. I too want to know what that code is doing. I use equations to explain, translate what a strategy does. If not, then I would have only an opinion, maybe an educated guess, and as such, it could become a trivial statement.

But don't worry. The math used in this thread, from beginning to end, was to demonstrate that the trading problem can be boiled down to a single equation: A(t) = A(0) + n*u*PT. With only three portfolio metrics of importance. Whatever trading strategy you design, when it will be time to tally results, the total profit will be given by: n*u*PT. The first variable, the number of trades made, the second, the bet size used, and the third, the net average percent profit per trade. It is all, just three numbers.

If you examine that equation, it is not that big a problem to solve. You want, over an extended period of time, to maximize n*u*PT to the best of your abilities under the constraint A(0), your trading capital. Whatever trading method you use to do so can be adapted to whatever trading style you want. There is nothing esoteric, it all ends in very simple math.

I prefer a fixed trading unit: u = p*q. This way, part of the equation is solved. This also makes my trading strategies scalable. The net average percent profit per trade will depend on the trading strategy's long term edge. Once that is found, I am left with the problem of finding ways to increase n, the number of trades. Whatever I do that will push n*u*PT higher should be worth investigating, finding the reasons why, to see if these trading procedures could easily be applied going forward.

Simulations are often explorations on how far you can go. It is a lot easier to scale down a trading strategy to a more desirable level that to scale it up. Now, that is my observation, an opinion, and I can not provide an equation on that one.

All trading strategies start, and end, with questions: Would you use that strategy in live trading? Would it survive over the long term? Will it outperform the benchmarks? Is that a trading methodology you like? Will you accept higher risk for higher returns? What will your strategy do in a black swan event?

But, whatever trading strategy you prefer, and this goes for any other trading strategy on Quantopian, it will have for answer the equation: A(t) = A(0) + n*u*PT. And that is not an opinion.

Stock Trading Profits: Take Your Share

My previous post (The WOW Factor) might appear at first glance as an exaggeration of some kind. For one thing, it is not a hoax or a data manipulation of some kind. It is just an aggressive trading program. It only needed deep pockets. The simulation was part of the development cycle where one tests for up and down limits. A lot of it is doable under more restrained methods. These added methods would have for only purpose to reduce the strategy's volatility and drawdowns. They would still generate high returns, lower than what was shown, but still relatively quite high compared to market averages.

But, here is a question. How much drawdown and volatility are you ready to bare for higher long term performance levels? If there is no volatility, there is no price variation, there is no return, or is there?

Since volatility is usually expressed using the standard deviation σ, when σ is approaching zero, are we not approaching a straight line? And if a straight line, where is the price variation Δp to make a profit since σ would tend to zero?

The same goes for a stock price having a low beta. Does it automatically say that there is no price variation, or that price variations are very subdued, both up and down, compared to a benchmark? So many questions. And yet, they all deserve answers.

Take, for instance, STZ over the past 5 years. You see a low beta stock with a low σ having its price almost going straight up over the period. Yet, the price increased with an average 50% CAGR for those 5 years. A lot of trading methods might not even have selected it as a trade candidate, (not enough variability) or predicted that it would behave the way it did (no highly discernible patterns). Nonetheless, you had in STZ one of the smoothest rides you could get.

The best bet scenario was to go all in from the start, or was it?

Doing this would have given you a 50% portfolio CAGR over the past 5 years, putting you in the top 0.1% of portfolio managers on the planet. Lower risk and lower beta than the market with a much higher return. Some 40 alpha points above market averages. Year after year the price went up. It wasn't what one might call a trading vehicle, but more like an investment. You bought and you held for the duration, riding this almost straight line up. Trying to time it would probably have produced less.

Where was the portfolio efficient frontier or the efficient market hypothesis on this one? How about the proverbial reversal to the mean thingy, it was as if nowhere to be seen. Should stocks behave like STZ or not? First, the question: is it possible, is not a question. One just looks at the facts, at what was there. The future still remains unknown, but for the past 5 years, that stock did great by all counts.

My question is: could you have done more? The answer is: Yes. Among other things, you could have reinvested paper profits. Say that, as STZ went up, at every 15-point rise you took the added paper profit to buy additional shares. That you did this or not, the stock price would still have gone up. That was not your decision.

Your decision was what do you do about it? Do you ante up or not? You will always be with that question: do you, or don't you make the bet? What are the odds that you win your bet? I do not know. You do your research to get the conviction you need to place your bet, or you pass.

Still, that scenario would have taken your CAGR higher for the period. Starting with $ 1 million, buying additional shares at every 15-point rise, starting at $ 20 some 5 years ago, by the time STZ reached $155, instead of making $ 6.75 million in profits, it would be $ 13.67 million. Instead of getting a 50.6% CAGR, it was raised to 71.1% for the period. Adding some 21 alpha points to your already high portfolio return. All due to a simple trading procedure. Not even guesswork, just a procedure with no predictive ability. It only said what you would do if the price went up 15 points.

So, yes, you can do more. But, like in everything else, you will have to do more to get there. Even if you put up half of the paper profits to work, it will still up your CAGR. Also, putting less on the table, cutting the initial stake by a factor of 10 ($ 100k), would give you one tenth the above profits, and still maintain the same CAGR as above. You have a scalable trading strategy by design.

And we can't say that it is a complicated trading method, requiring a PhD to understand, or even a computer to execute. It does not even require much of your time. You could put it on a machine to diversify your bets, to do a lot more stocks at a time, all that would be required is more capital which would produce a lot more. If you can scale it down, you can also scale it up and maintain its CAGR.

Would this have added risk? Yes. But note that it is not the market risk that increased. The beta did not change, the σ was the same, and yet, your risk increased. It increased due to the method of play. Not because of some structural change in the market, but by what you were doing as portfolio manager. At the start, you were taking the same risk as anybody else taking a position in STZ. It is only at $ 35, that you added some shares, with already a 15 point profit in hand. I don't see risking paper profits the same as risking capital. One is, I risk their money, while the other is that I risk mine.

You could have quit at any time, at any step, on the way up. If you felt ill at ease, as presently for example, you could exit the entire position with all the accumulated profits. Twice as much profit than not having executed that simple procedure. This also puts an opportunity cost on a single decision of yours, on not doing a simple task.

That says that maybe your real job might have been to find STZ. That was not very hard.

It was making new highs almost every other week over the past 5 years. That is 1,825 days where, every day, you were reminded that STZ was going up (1,300 trading days). That you started at $ 20, $ 25, or $ 30 would not make that much of a difference. But what would, would have been not participating at all.

Finding STZ in a market that has been going up for the past 7 years, how hard could that be? It was floating on top a sea of variance. Still, it clawed its way up penny by penny. Don't think for a minute that STZ was alone making new highs over those past 7 years. It had a lot of company. It was not the only scenario available. You could have had hundreds to choose from. That is where your computer comes in handy.

I hope some see the points I am making. The stock selection process might not be that difficult, but the method of play should be such that you can enhance on what is out there.
The profit reinvestment procedure was done, without trading, only to show a first step in getting there.

A stock with higher volatility (σ) and higher beta, can give one the ability to trade over the process, meaning that you can up the ante again. The higher beta, higher sigma stock is providing more trade opportunities, more: Δp>0 with greater amplitude.

A higher σ, or a beta exceeding 1.00 say that the stock price swings more than the average. And this represent larger profit opportunities too. Again, do you take them or not. It is not the market that is going to decide for you, unless you let it. Nonetheless, that you delegate this decision to the market, to a program, keep it discretionary or not, it remains your decision.

Oh yes, you would not have the ability to know when STZ would hit its 15-point markers as it was going up, but then again, did you know that before? I don't see what you would be missing, since I do not think your trading methods ever gave you a clue on that one either. Otherwise, you would have been all in at $20 and stayed in. However, your programs too could have observed that, hey, STZ is going up...

The price of a stock is the representation of a company's value as a business. In one number you have a valuation, an estimate of its past, present, and its discounted uncertain future. That is what is tradable: the uncertain future. But you already know this. If a company is prosperous, it is making more money. It is increasing its valuation, and that is reflected in a future higher price. Before you want to participate, provide some risk support that someone else do not want anymore, you want to see some evidence that the company is indeed prospering. And that can only be shown by a higher stock price. If they don't succeed in showing you some Δp>0 over a recent period, why would you buy? Let any stock first show you that it has a Δp>0 over your period of interest, then you may get interested in it. And if at some point, it disappoints, dump it. You are in the business of making your portfolio prosper, and not in absorbing losses.

In all, if you want more, you will have to do more.

A Stock Trading Strategy Signature

This is the continuation of: Playing the Stock Market Game: Time is All

Repeatedly applying an automated trading strategy to a bunch of stocks in a backtest will produce the same answer every time. It is the output of a program. A recipe, a set of trading rules, procedures, coded instructions and software routines.

Since the output of a trading strategy can be expressed as a time function: A(t) = A(0) + n∙u∙PT, then, A(0) + n∙u∙PT is its unique signature. Leaving us with 3 portfolio metrics of consequence.

There may be millions of trading strategies out there, and many more not yet designed. Each has its unique signature. You apply any one of them, and you generate: A(_k)(t) = A(0) + n∙u∙PT.

Due to this equation, the output of any trading strategy can be compared to any other. It also means that if you run my trading strategy on your computer, we both get the same answers. It is just a program being executed.

There lies part of the problem: the strategy's signature. You only have 3 numbers. Two of which you can set yourself. The other a sequential counter of your trading activity.

People play a short term stock market game as if in a none random-like environment.

Stock prices might not be totally random, but, on the short term, they sure have a high noise to signal ratio. So high in fact, it is hard to distinguish and separate the background signal from the predominant ambient noise. The signal is literally buried in a turbulent sea of variance.

It is understandable. If price variations were less randomly distributed, then you would be able to make better predictions, and be able to quantify them. Give them reliable occurrence probabilities, improve on allocation methods and betting procedures. There is a lot of money involved should you become good at it too.

However, in this buzzling statistical swarm of price variations it is difficult to make highly accurate forecasts. Which in itself gives an indication as to the high degree of randomness in price fluctuations.

What most strategy develop design are trading strategies somewhat adapted to this unique past swarm of price variations. That too could be an expression of randomness since a lot of these trading strategies tend to break down going forward. Why do they break down if their past data was somewhat representative of their future? Were bets not made pursuant to their “predictive” analysis?

The future too is a unique occurrence. It offers no replays.

If a trading strategy has this distinctive signature, then, it is all there is. Or, is it? Is it all it can do?

Have we for only solution to find better and better strategy designs as a way to improve performance?

This quest has been on for decades, and still, most portfolio managers have a hard time beating averages.

Note, that the average is almost given away, as a kind of default value to anyone willing to participate for a long time. The market average does not set the bar that high having for secular trend a little less than a 10% CAGR (dividends included). So, how could you not outperform the averages?

Is your search reduced to continuously finding ever better trading strategies which become better adapted to their singular past? It is a real conundrum. The better they get, the more they are adapted to their past, over-fitted, and the more they might break down going forward. Becoming totally misaligned with reality and maybe even condemned to underperform averages, or worse, destroy one's portfolio.

Even with the high degree of price randomness, you still design trading strategies that backtest well on your selected stocks, but with a limited future. Are you bound to design trading strategies having a high propensity of achieving close to market averages? And this, not necessarily due of your program per se, but just because you participated in the game.

It is why you have to look at the problem differently. As simple as that.

It is not by doing what everyone else is doing that you will exceed what everyone else is doing.

It is by finding new ways, exploring untried avenues, looking at the total picture and not just from period to period. It is by giving your trading strategies a long term vision that you will stand a chance of outperforming the majority out there.

If you don't do it, well, that is a matter of choice too. You can always rely on index funds to at least give you close to average returns over the long run. But there too, you will need to put in the time.

Redesign Your Trading Strategies

Then again, you might wish to redesign the whole thing from scratch. Your trading strategy might have a unique signature, but that does not mean it is the end of it.

On the contrary, it might just be a starting point, the initial block of a trading methodology. This does not mean you will be able to escape the portfolio's equation: A(t) = A(0) + n∙u∙PT. The same equation would apply to a portfolio of diverse asset portfolios: Ʃ A(_k)(t).

Nonetheless, I do state: you could do better by controlling those 3 portfolio metrics. Redesigning them as time functions: A(t) = A(0) + (1+f(a))∙n∙(1+f(b))∙u∙(1+f(c))∙PT. To increase performance, the only requirement would be: f(a) > 0, f(b) > 0, f(c) > 0, or any combination thereof.

It did not change the signature of the trading strategy. It only emphasized your long term action. Stuff, procedures you could add to your trading strategy to make it behave the way you want it to behave.

For instance, you could increase the trade unit with time: (1+f(b))^t ∙ u. It will impact your portfolio for its entire duration, and show on your total return. Increasing u is increasing the bet size going forward, it does not change the decision points, only the quantity traded. But with the net result of increasing performance: n∙(1+f(b))^t∙u∙PT > n∙u∙PT.

What would happen? With time, these functions would increase the importance of each of the 3 portfolio metrics, increase overall performance by a factor of: (1+f(a))∙(1+f(b))∙(1+f(c)). This, without changing the strategy's signature, or its coded logic.

It shifts upward the CAGR curve, ever so slightly in the beginning, almost imperceptibly. But gradually, the CAGR curve would improve, widening its spread compared to a benchmark, and thereby be an alpha generator on its own. A self-engineered one at that.

You can outperform the averages just by changing your point of view on the problem. The strategy will stay automated. It will respond to these 3 scaling and controlling factors: (1+f(a))∙(1+f(b))∙(1+f(c)), and increase performance. Not due to randomness, but to your preset controls.

We are left with 3 questions. How can we increase n? How can we increase u? And, how can we increase PT? Better yet, how can we increase all three at the same time over the long haul? After all, at bean counting time, you want to have reached the finish line!

This is how you will exceed your trading strategy's signature.

This post is also available here:
http://alphapowertrading.com/index.php/papers/240-a-stock-trading-strategy-signature

See related articles:

Playing the Stock Market Game: Time is All
http://alphapowertrading.com/index.php/papers/239-playing-the-stock-market-game-time-is-all

Boost Your Stock Trading Performance:
http://alphapowertrading.com/index.php/papers/234-boost-your-stock-trading-performance

Why Most Trading Strategies Fail

If a stock trading strategy is designed to generate thousands upon tens of thousands of trades, it will asymptotically approach a kind of law of large numbers. Meaning that the numbers: in n∙u∙PT will become more representative of the whole due to the sheer size of n.

These three numbers might start as metrics in your portfolio backtest, but due to the large number of trades taken, they also become the trading strategy's unique long term signature. You will be able to use the words: on average.

If your portfolio backtest was over the past 20 years, it should provide a pretty good approximation for the next 20.

It goes like this. As the number of trades increase, u∙PT tends asymptotically to a limit. This is easy to visualize. Take 100,000∙u∙PT. Then, add one more trade. You will not see PT move by much. In fact, the added trade's profit percent will tend to be close to PT, the average. Since 1/100,000 of the difference will be able to make it move. The same applies if you put in a million trades. The formula is: lim (n → large n) Σ(H.*ΔP) / n = u∙PT, the net average profit per trade.

A long term backtest is becoming a reasonable approximation of what your trading strategy will do in the future. We have an explicit equation to make this estimate: A(t) = A(0) + n∙u∙PT. This can be said even in the face of usual disclaimers like: “past results are not indicative of future performance” which in fact will hold if you keep the word performance as in return.

You will not know in which stock, at what time, or at what price trades will be taken going forward. But, you do know, right now, that your trading strategy will continue to execute trades as instructed and as programmed. It will produce, on average, about the same output per time unit going forward as it did in the past in its backtest.

This puts a lot of importance on the long term backtest. You want to know the approximation of the asymptotic limit of u∙PT. You want to know the trading strategy's distinctive signature. And, it will be given for a large n. Meaning for a trading strategy generating a lot of trades over an extensive period of time.

This will also give how much you had to put on the table to achieve that goal. That is: n∙u. Evaluating your performance becomes easy as well. It will be:

A(t) / A(0) = (A(0) + n∙u∙PT) / A(0)

It is also from here that you will see why most trading strategies slow down going forward, if not fail to maintain their performance level.

We already stated that due to a trading strategy's signature, and the law of large numbers we should see our trading strategies do about the same as they did in the past. This over extended periods of time. Time was a basic requirement for having a large number of trades.

Take for example a backtest done over the last 20 years producing: n∙u∙PT in total profits. It might not matter how large n∙u∙PT was. So, let's make it huge. Make it such an outstanding backtest that it could result in only one conclusion: this is the trading strategy to be used for the next 20 years. It is that good.

Then, as expected, over the next 20 years you get about the same results as the 20-year backtest. Great. Your trading strategy lived up to its expectations.

The total outcome is in: A(t) = A(0) + n∙u∙PT + n∙u∙PT. Over the added 20 years, you got about the same amount of profit as in the backtest.

The strategy was expected to do about the same number of trades, had a constant trade unit, and PT tended to a limit. Therefore, you do get about the same amount of profit in either of the 20-year periods. So, what your trading strategy did in the past did become indicative of what it would do in the future.

Doubling profits over a 20-year period is a 3.5% CAGR. Nothing more. Now, that is a bummer. Still, those are the numbers. All your trading strategy could do over the added 20 years would be to double its total profits, at most.

You could have done better during those 20 added years abandoning your trading strategy altogether. Not trade it at all, and buy index funds. This, no matter what your trading strategy's performance level would have shown over its backtest.

The nature of the market will probably not change during those added 20 years. Neither would your trading strategy, it would have been frozen in time. It would have kept a relatively stable u∙PT, due to the large number of trades. It would have generated: n∙u∙PT.

And, yet, you would have been better off to scrap your high performing trading strategy rather than having it go live, and underperform market averages.

I hope I am stressing the point enough.

You have to take measures to force your trading program to increase those three portfolio metrics to compensate for what is a built-in and normal performance degradation.

I have shown how this can be done in recent articles. Maybe most importantly, how this compensation can be done with ease.

If you do not do it, it will not happen.

If you do not compensate for these inherent structural gaming deficiencies, the market will not do it for you. Nor will your program.

Going forward, your trading strategy will simply fail over the long run. And this, no matter how good it was.

It will fail for doing what it did best.

It will fail, not by doing less, not by breaking down, not due to changes in regime. But rather because it will be doing the exact same things it did in its backtests.

Technically, it does not matter how good your trading strategy was, it will not be able to do more. Its upper limit is: A(t) = A(0) + 2∙n∙u∙PT over those 40 years. With the first 20 years just to show you could get: n∙u∙PT.

Your trading program is just a program. As it turns out, it would simply not be enough to have it do the same thing going forward as it did in its backtest.

One has to compensate. No alternative. No other choice. On the other hand, you might find that n∙u∙PT is enough.

This is part of the math of the game. You can ignore it. But... there is a price!

See related articles:

Stock Trading Strategy Math I
http://alphapowertrading.com/index.php/papers/241-stock-trading-strategy-math-i
A Stock Trading Strategy Signature
http://alphapowertrading.com/index.php/papers/240-a-stock-trading-strategy-signature

Just published my new book: Building Your Stock Portfolio.

It is available on Amazon: http://www.amazon.com/dp/B01MYCRVEG

Building Your Stock Portfolio has for sole purpose to help you make more money. It is about you building a long term stock portfolio for whatever reason you might have, and making sure you reach your goals.

Is presented the making of a trading philosophy, a methodology which hopefully could become part of yours. My main objective being that you will not be copying what I do, but doing what will be right for you going forward.

You could apply in a discretionary fashion what will be presented but will find ways to delegate most of the work to a machine which will run your program under your terms.

Building Your Stock Portfolio will help you structure and build your trading strategy to do what you want. It will emphasize the major points to consider along the way.

It is about designing trading strategies made to survive and thrive over the long term. Correct time, gaming related deficiencies, and help you engineer alpha from within the method of play itself. All designed so that one's stock portfolio will outperform market averages over the long term.

Basic Portfolio Math

Some of the stuff in portfolio management is so basic that we often forget how really basic it is. The building block of a portfolio is the position taken in some shares of a listed company as an investment or as a short-term speculative move. In both cases, the objective is to make a profit. We buy an asset and hold on to it, or resell it later on for a profit. Trading is simply doing the latter more often.

The problem is not with the understanding of the game, it comes from asking very basic questions, like: what, when, and how much. An even more basic question is: why initiate that trade, at that time, in the first place?

Designing Your Strategy Your Way

My last article: Reverse-Engineer Your Trading Strategy ended with:

"... you need to design something better. The long-term 30-year prize
is worth \(\$2,199,269,115\)+. So, sit down, and figure it out! "

One might think this would require extraordinary skills to be deployed, when, in fact, staying power might be one of the main ingredients. Undertaking a 30-year endeavor is easy to state. Having an automated trading strategy doing the job however will require persistence, consistency and long-term marketability.

Every single CAGR point you gain above the suggested 20\(\%\) makes the ending objective even more desirable. Mr. Buffett has managed a 20\(\%\) CAGR over his 50-year plus career. Why should you not be able to do the same, or maybe even do better?

The follow-ups to the above-cited article will deal with what is required to achieve those objectives. Evidently, the payoff matrix will be at the center of the math behind these trading strategies. I intend to go from the math to how to design such a strategy out of the many possibilities within your own objectives and portfolio constraints. You might find that the limits you put on your own strategies might be your major drawback.

Articles that have led to this point are cited at the end of that article.

Reverse-Engineer For More Profits

We design stock trading strategies simply to make money. The more the better. But it all has to be done within constraints of available capital and minimizing overall risks. Trading has a number of differences when compared to long-term investing in many regards. A trade, almost by definition, is seen as a short duration thing that can come out profitable or not. While in the long-term setting of investing, durability, appreciation and overall trends gain more importance. Short-term fluctuations are practically ignored while trading might live by them.

But whatever the trading strategy, it has some basic math to explain what it does. Not sophisticated math mind, as will be demonstrated here, but inherent structures nonetheless that are dependent on the how the trading is done. Most of the text that follows is about averages, and we can use these averages due to the large numbers that will be used. In all cases designing diversified portfolios with hundreds of stocks and thousands of other possibilities.

It Is All About Your Choices

In the end, it will all be about your choices. The way you see your own trading environment and how you wish to interact with it. And all this within your own constraints.

As mentioned before\(^1\), any stock trading strategy can be represented by the following set of equations: $$F(t) = F_0 + \sum^n_1 (\mathbf{H} \cdot \Delta \mathbf{P}) = F_0 + n \cdot x_{avg} = F_0 \cdot (1 + g)^t = F_0 \cdot (1 + r_m + \alpha_t - ex_t)^t$$ The 4 equal signs above give the same final outcome which is the value of the total sum of realized profits and losses over the investment period based on the trading strategy matrix \(\mathbf{H}\).

A general curve for: \(n \cdot x_{avg} = \$10,000,000\) is displayed below:

Total Outcome Combinations

All the combinations of \(n\) and \(x_{avg}\) in the above chart give the same answer. And as such, a large number of strategies can satisfy the above. 1,000,000 trades with an average net profit of \(\$\)10, or 50,000 trades making, on average, \(\$\)200 per trade give the same answer: \(\$\)10,000,000. Therefore, your performance will depend on those two numbers and how you will extract them or build them in your trading strategy.

A Basic Formula

If you look at the composition of \(x_{avg}\) you have: \(x_{avg} = u \cdot PT\), where \(u\) is the bet size, the trade unit, or the stock allocation, and \(PT\) the average percent profit on the trade. Here, you could also view \(PT\) as some kind of average profit target. However, it should be noted that this is an average \(PT\) and overall will fluctuate with time. What was used is simply an average based on the average net profit per trade as reported for instance when using the round_trips=True option in a backtest analysis.

Making \(\$\)10,000 bets and taking, on average, 2\(\%\) on those bets could satisfy the above relationship. Therefore, this is not that big a deal. What is required is making it 50,000 times over the 30-year life span of this portfolio. This could be done with 1,667 trades per year with an average 2\(\%\) net profit target. Nothing here that could be considered as unrealistic. That is a 40 cents move on a \(\$\)20 stock or a price move of \(\$\)2 on a \(\$\)100 stock. Either of which can occur on a daily basis multiple times on quite a number of stocks.

Furthermore, 1,667 trades per year is less than 7 trades per day on average. In the beginning, 7 trades of this type could even be done by hand on a discretionary basis. However, with time, it would require a lot more monitoring since this number should increase over time. Your trade monitoring time is also a trading expense, even in an automated trading strategy, and even if it might be at a lower level.

The problem is the same, over the next 30 years, if your goal is to reach \(\$\)172,494,023 (a 10\(\%\) return) or a 20\(\%\) CAGR or more giving \(\$\)2,363,763,138 or more based on an initial \(\$10,000,000\) capital.

You have to determine the bet size and the average percent profit per trade you or your program can reach. From the numbers, it should not be that difficult. That you decrease the initial stake by a factor of ten, you will have to also reduce the ultimate outcome by a factor of 10.

The first question might be: are there really that many 2\(\%\) moves in those stock prices? The answer is: there are a lot more than enough to do the job. But, you are not necessarily limited to just a 2\(\%\) average profit per trade. There are so many ways to handle this problem.

A long-term stock trading program should be dynamic, it should change over time in order to satisfy the long-term objectives, and mostly it should be consistent with these objectives. Most of the time, I see strategies that use constants that will prevail during the portfolio's entire trading interval. On what basis should a constant be considered in an environment that fluctuates all the time?

We need to understand the dynamics of the payoff matrix. From the above equation: \(n \cdot x_{avg} = n \cdot u \cdot PT\) we need \(n\), \(u\), and \(PT\) to increase with time in order to reach these goals. Overall these increases are not that large since all of them are spread over time and need to respond to how far or how long you have been on the task. It will depend, evidently on the initial capital used and the design of your holding matrix \(H\).

The table below presents one possible scenario out of the multitude of other solutions. Starting with a 30-year CAGR objective with an initial \(\$ 10,000,000\) capital. It shows that an average profit target per trade of about \( PT = 2\% \) to \(PT = 3\% \) could have been sufficient to reach the objectives based on the trading unit used which were relatively small to start with.

The Payoff Matrix Projections

The numbers used are relatively rough as should be expected. There is no finesse here, only some estimates that fulfill the stated objectives. And as we could surmise even without doing any calculation, that there would be more work to be done the higher the CAGR objective. But, most of it was resolved by simply adding more stocks to trade at each level while increasing the average trade unit and the average profit per trade.

All in all, not that big an endeavor, but still requiring to be consistent and be there for the duration while continuously executing those trades.

I will stress that what is presented is not the only solution. What counts is adapting your trading strategy to comply with your long-term CAGR objectives. One thing is sure, if you do cut the initial capital by a factor of 10 or 100, then you should expect to revise those numbers to the downside and should expect also to reduce the total outcome by a factor of 10 or 100. In simple compounding return math: \(F_0\) as a scalar does matter.

You want more, then you will have to design that in too. You could consider each component of \(n \cdot x_{avg} = n \cdot u \cdot PT\) as time-varying functions. Making them adapt to the trading environment. For instance, \(n\) is an ever increase monotonic function as it should be since it is simply a trade counter. The more you can increase this number with all other things being equal, the more your outcome will rise. Nothing extraordinary there, again simple math.

It is how you will make your payoff matrix follow your long-term objectives that will matter. But, no matter what is done in those trading strategies, they have to comply with your own trading limits, constraints, and aspirations. It is this balance that needs to be met since overall you need the confidence necessary to apply those trading strategies knowing that that is where you will end up by following your payoff matrix as you designed it.

If you do not know what your trading strategy is really doing and on what basis it is operating, how could you ever have any confidence that it will get you where you want to go?

Do your own table as above, with your numbers, then figure out how your program should achieve them, or modify it to reach those new objectives. It is a matter of programming your strategy to fulfill those objectives. And there, there are a lot of trading strategies that can do the job. It is all in your hands. It is all your choice.


\(^1\) Reverse-Engineer Your Trading Strategy

Design Your Trading Strategy And Retire

We often design stock trading strategy simulations by first programming them on some economic notion and then observe the outcome. As if the trading procedures, over the long term, would resolve the appreciation problem all by themselves, when a more global view should be taken. The where you want to go and how far will it take you?

Most of it could be determined beforehand. More planning and a better outlook as to what you really want to do.

You design something and wait for the outcome, or you design the desired outcome and then find ways to make it happen.

Most often, time will prove to be a major ingredient in that equation.

My previous article broke down a portfolio's payoff matrix to 3 numbers. They gave the final answer to the outcome of a stock trading portfolio, no matter its size or composition:$$F(t) = F_0 + \sum^n_1 (\mathbf{H} \cdot \Delta \mathbf{P}) = F_0 + n \cdot u \cdot PT$$ A table with those numbers was provided to achieve different possible CAGR scenarios. They were not the only solutions, infinitely more are available and in all cases the equal sign will hold.

All the profits and losses, whatever their origin, were accounted for in the equation: $$ \sum^n_1 (\mathbf{H} \cdot \Delta \mathbf{P}) = n \cdot x_{avg} = n \cdot u \cdot PT$$ where \(n\), \(\,u\) and \(PT\) were program variables which, technically, you can design to be whatever you want.

For instance, someone who bought Berkshire Hathaway some 50 years ago and maintained his position (about 30 did so) would have: \(1 \cdot \$10,000 \cdot (1+ 0.20)^{50} = \$910,043,815\). More than enough to pay for coffee and retire.

A single trade decision was enough, sitting down and waiting was the only thing required. That the market went up or down on a daily basis, you still had to just sit down and wait even in periods of market turmoil. Berkshire Hathaway has had 4 major drawdowns in excess of 50\(\%\) over that period.

Then the question is: what was more important? Staying the course or getting out at the first sign of trouble? Shouldn't someone have introduced some capital preservation measures in the process in order to alleviate the drawdowns?

What Will You Do Going Forward?

The problem is not what others did, but what you will do going forward?

I can say, whatever you do, it will have to comply with the above math. There is no escaping it.

You trade, you will generate a certain number of trades over the entire trading interval, no matter how long it is. You will generate profits and losses. That you do win or lose, it can all be averaged out.

It does not make sense to build a portfolio for 20 years and see it all fail in a couple of months due to poor planning and poor execution. We cannot say that this thing is that complex. You have only 3 numbers to watch for. Only 3 questions to answer:

\(\quad\) 1) How many trades (\(n\)) can my program do over these 20 or 30 years?

\(\quad\) 2) What is its average bet size (\(u\))? \(\,\) Hint: \(F(t) \div j\).

\(\quad\) 3) What kind of average edge per trade (\(PT\)) can I get?

Whatever your trading strategy does, to further improve performance, you need to answer the following questions:

\(\quad\) 1) How can I increase (\(n\)) over the trading interval?

\(\quad\) 2) How can I increase the average bet size (\(u\))?

\(\quad\) 3) What can I do to increase the strategy's average edge per trade (\(PT\))?

It is not a matter of curve-fitting. It is doing what will increase those numbers while maintaining executability.

The 3 numbers mentioned become some kind of program pressure points. With all other things being equal, increasing any one of them will improve on the final results. Since you have only those three numbers:\(\;n\), \(\,u\) and \(PT\), you will have to find ways to increase the number of trades if you want to increase the final results. The same goes if you increase the trade unit \(u\) (the allocation). These are critical numbers to your trading strategy just as is \(PT\), your program's average trading edge.

The trading game is not an instant lottery game. It is a long-standing endeavor just as investing is. It is only that the rules of engagement are different. But, whatever trading methods you intend to use, those 3 numbers will prevail, that you like it or not.

Trade Allocation

The initial stock allocation is rather easy to determine. You intend to trade \(j\) stocks in your portfolio, then: \(F_0 \div j\). For a 400-stock portfolio, we have: \(\$10,000,000 \div 400 = \$25,000\), or \(0.25\%\) of equity. This means a stock could drop to zero and only damage the total portfolio value by \(0.25\%\)! You could use any other kind of allocation as well. It depends on what you want to do and how you want to do it.

Should you opt to trade only 5 stocks in your portfolio. The math with change. The bet size will increase to \(\$10,000,000 \div 5 = \$2,000,000\) and represent a \(20.00\%\) drop if a single stock goes to zero. Those are not nice odds. You are definitely better off to diversify and thereby reduce your market risk. Nevertheless, the market will take whatever bet size you want to put on the table. It does not care a bit that you win or lose, nor how much you bet.

You should be in control of what you do and not let emotions or the thrill of the game dictate what is to be done.

It Is All About Your CAGR

The table in my previous post showed the case for long-term \(5\%, 10\%, 15\%\) and \(20\%\) CAGRs. The \(5\%\) case is about the long-term average for individual traders trying to make it on their own (refer to academic papers on the subject). The \(10\%\) is about what one could expect using index funds over the long term. Usually a little less due to all the expenses and management fees.

To reach the \(15\%\) CAGR level, you need to add some alpha to the game. This can be achieved using better timing methods, better stock selections, and better trading techniques. What you want to see is: \((1+ g_m + \alpha) = 1.15\) which would require an alpha of about \(0.05\), which is not that much but is still hard to get.

The majority of fund managers, over the long term, have failed to even achieve this. And with all their resources in manpower and equipment, not to include the best minds out there, what could make you think that you can outperform these guys without designing better methods than theirs? You have to innovate and reengineer your trading methods for where you want to go and not just hope that somehow, over the long term, by some kind of luck, you will get there.

Everywhere, in this trading game, you need to be reasonable. Everything needs to make sense. The big question: is this kind of trading methodology feasible or not? It should always be asked.

However you trade, the money has to come from somewhere. You want to make it in a one-shot deal, then you better be right! I agree, nothing beats the biggest bet on the biggest move. But, the question should be: can you support the risk? Can you find this big bet? Can you predict that "black swan", that outlier that might appear once a generation, or once in a thousand years? That kind of bet is not for everyone. Your goal should not be to bet on those things but to make sure that over the long haul you win and win big. You want to build your retirement fund, that is your objective.

Already, with a \(20\%\) CAGR over the long term, you could mimic Mr. Buffett's portfolio return. That is \(10\%\) in alpha points which few have realized over the past 50 years. You know it is reasonable, you have Mr. Buffett's example that it has been done (and there are others that have done it too).

There are advantages in trading that are not found in investing. This is where you should concentrate the efforts to increase this alpha even further. Go for \(15\%\) or \(20\%\) alpha points to jack your CAGR to \(25\%\) or \(30\%\). This will make quite a difference over the long term. It is a compounding game after all, and time is a major ingredient in the solution to the payoff matrix.

Doing More

In the following table, which is an extention to the previous one, I raised the CAGR up to a \(30\%\) level with an example of the number of stocks and trading unit that could be required to do the job.

The Payoff Matrix Projections Extended

We should notice that to increase performance, the strategy traded more as we got along, just as the trade unit \(u\) was increased. However, the requested average profit target was not increased that much. It was gradually increased from \(2.0\%\) to about \(3.2\%\). This is looking for, on average, an average \(2.0\%\) to \(3.2\%\) price change on a weekly basis. The bet size was also gradually increased.

It is all about your trading methods and your choices. Millions of other number combinations could have been used to reach the same objectives.

You Can Do It

The point is: can you force your trading strategy to do such things? And the answer is: definitely yes. It is your planning that matters here. The how you look at the game and the math behind it.

For instance, from the above, you know that you have to increase the bet size as you go along. That is not difficult. It can be incorporated in your trading strategy design simply by adding to the number of stocks you are going to trade. Or, simply increase the trading frequency or use some leverage.

Your initial bet size is proportional to \(F_0 \div j\) as stated earlier for an equally weighted scenario. As the portfolio grows, the bet size will grow proportionally since the trade unit will remain proportional, on a continuous basis, to the number of stocks traded \(\,u(t) = F(t) \div j\). You can fix the allocation to a fraction of equity as: \(1 \div j\).

So, yes, the trading unit will vary with time following in locksteps with the portfolio's equity line. But this should not be surprising since at the start of the trading strategy the number of stocks to be traded was fixed \(j\).

It is why in each CAGR scenario, the number of stocks to be traded was increased as the estimated CAGR level increased. This is done in order not to accelerate the bet sizing too much and maintain a lower estimated average profit target to do the job. Evidently, increasing the average profit target will produce even more.

This is quite a different structure for a trading strategy setup that we usually see in academic papers, or in practice for that matter. But, nonetheless, everything holds. If you want to achieve more out of your trading strategy you will have to provide more time and trade more with the preset notion of where you are going. One thing is sure, you will not be able to escape the above equation no matter what you do. And ignoring those 3 numbers will not make them go away either.

I thought I would share my last article published on LinkedIn. It is related to the above post.

It looks at the number of trades generated by a rebalancing function.

The article states that rebalancing can dictate the number of trades that will be taken over the life of a portfolio simply knowing or having an estimate of its turnover rate.

For instance, the math can estimate how many trades would be executed for a 400-stock portfolio over some 20 years if you have an estimate of the turnover rate which we can get from a single simulation.

This says that the rebalancing procedure itself will preschedule the trading activity.

Follow the link:

https://alphapowertrading.com/index.php/2-uncategorised/364-the-portfolio-rebalancing-gambit-i

My latest article published on LinkedIn, also related to the above subject, should bring added insight into the restructuring, or reengineering, of a long-term trading strategy.

The article further elaborates on the portfolio's payoff matrix equation and presents it as a tool to reach long-term objectives. It also makes the point that you can design a stock trading strategy that can profit from market noise in the most simple of ways.

Follow the link below:

https://alphapowertrading.com/index.php/2-uncategorised/365-the-portfolio-rebalancing-gambit-part-ii-of-iii

My last article of the rebalancing series elaborates on the use of a portfolio's payoff matrix equation. It presents different scenarios based on initial settings which could be programmed according to one's long-term objectives.

You have here an equation, not some opinion, but an equation that dictates the long-term outcome of a periodically rebalanced trading strategy. It can be used to make estimates of a portfolio's payoff or help build prototypes of strategies based on their internal settings.

Whatever the trading strategy you want to automate, even starting from a discretionary basis, it will end up complying with the shown equation. The equation is saying explicitly what are the variables that matter and where the strategy's pressure points are.

You have tried factors, indicators, various stock selection methods, winsorizing, z-scoring, combined factors, pairing, market-neutral, beta-neutral, long/short and hedged scenarios, regressing this and that and more, all of which expressed as mathematical formulas incorporated in your trading logic. A payoff matrix can include any of these, even all of them, but with a vision of the big picture. The question is: What is the long-term objective of your trading strategy? That payoff matrix equation is giving you an answer, at least, an estimate.

If your trading strategy does not survive over the long term, it is worth absolutely nothing. Period. To be worth something, your trading strategy needs to generate some alpha over and above long-term market averages, otherwise, an index fund could have performed as good or better than your strategy did which would have been a better alternative than your strategy.

The payoff matrix equations are tools you can add to your trading arsenal. You have absolutely no obligation to use them. It does remain your choice after all.

Follow the link below for more:

https://alphapowertrading.com/index.php/2-uncategorised/366-the-portfolio-rebalancing-gambit-iii

My latest article is related to the above series of recent posts on a strategy's portfolio rebalancing structure. There are some quite interesting points in it and I thought it might be of some use to some.

Simply follow the link:

Lessons From The Portfolio Rebalancing Gambit

https://alphapowertrading.com/index.php/2-uncategorised/367-lessons-from-the-portfolio-rebalancing-gambit

The Inner Workings Of A Stock Trading Program

My last article admitted that the trading strategy used was effectively trading on market noise. Even under those conditions, it could win and win big. It is surprising that, after such a statement, system designers were not in an uproar and making all those points that could be made to rebuke the claims. The article went even further by providing a portfolio payoff matrix equation which enabled making long-term estimates of the portfolio's future value.

This equation is not common, but most certainly, it is ordinary.

The equation illustrated the point that a rebalancing stock trading program has an inherent structure. The way it was designed would determine what it would do going forward, or for that matter, going backward as in a simulation.

Having an equation to explain the behavior of your trading strategy takes away all the pseudo-things you might have to say about it. There is no secret sauce, no the trick is this or that. You only have a rather plain math equation with an equal sign. An equal sign is not an opinion on something, it is a statement. Here it is again:

\(F(t) = F_0 + \Sigma (\mathbf{H} ∙ \Delta \mathbf{P} ) = F_0 + y ∙ rb ∙ j ∙ E[tr] ∙ u(t) ∙ E[PT] = F_0 ∙ (1 + g)^t\)

where \(y\) is the number of years the rebalancing is applied, \(rb\) is the number of rebalance per year, \(j\) the number of stocks in the portfolio, and \(tr\) the expected turnover rate. u(t) is the betting function and E[PT] the expected average percent profit margin. The portfolio had its equivalent growth rate expressed as \(g\).

Rebalancing

No matter what you did or how you did it, the equation would prevail.

The application of this equation only required a scheduled periodic rebalancing function applied to the selected stocks. The program used something like the following line of code:

schedule_function(rebalance, date_rules.week_start(), time_rules.market_open())  

And that single line of code was sufficient to predetermine how the strategy would behave with its selected stocks for the entire duration of the portfolio.

In the above equation, if you increase the number of years \(y\), you will increase the final outcome. If you rebalance 400 stocks \(j\) on a weekly basis \(rb = 52\) with an estimated turnover rate of 40% \(E[tr] = 0.40\), the strategy will make on average 8,320 trades per year. You do this for 10 years \(y = 10\), the estimate goes up to 83,200 trades. This, without even knowing how the trading strategy will actually trade. If you do it for 20 years \(y = 20\), you could reach an estimated 166,400 trades.

It is the structure of the program, its rebalancing procedure, that is dictating how the trading strategy will behave.

That it be in a simulation or going forward. It is the expected average turnover rate \(E[tr]\) that will determine the number of trades that will be executed. You increase the turnover to \(E[tr] = 0.60\), it will increase the number of trades to 249,600 over those 20 years.

No reason is given for any of the trades other than due to the weekly rebalancing procedure.

The program will trade no matter what. If you increase the number of stocks to 500, over those same 20 years with the same turnover rate, it would increase the number of trades to 312,000. Yet, there was no internal change to the program. Only the number of stocks in the portfolio was increased, and that decision was not made by the program, but by the program's designer.

The number of stocks to trade is an independent trading decision, just as a weekly or monthly rebalancing, or how long you want it to last.

You can do a simple napkin calculation to determine how your trading strategy will behave over the long term without even engaging in a simulation. It will give you the expected number of trades \(E[n] = y ∙ rb ∙ j ∙ E[tr]\) over the entire expected life of the portfolio.

It is the structure of your program that is dictating the number of trades your trading strategy might do over the years. Note, the number of trades your trading strategy will do does not say you will make a profit, only that, on average, as an estimate, you will do that many trades whatever their respective outcomes.

So, there really is no secret sauce in the number of trades to be performed, that was fixed from the start with the rebalancing scheduled function. And if you think that it is your program that is going to determine the number of trades, think again, since the rebalancing function has control over this and market variance, market noise will be sufficient to trigger all those trades.