July 8, 2019

Answering a question in a Quantopian forum about the variables used in the presented equation in my last article.

Those variable names expressed averaged out functions: dampers, boosters, accelerators, amplifiers, and controllers. As their names imply, they are made to increase or decrease the impact of the controlling functions as the strategy moves along. Each playing their part somewhere in the program with the meaning you would give to those names.

The objective is to gain some control over where your strategy is going and at what speeds. You want to push to the upside when the market is going up and evidently to the downside when it is going down.

Nonetheless, you put in added precautions to the downside using dampers subject to controllers. However, to the upside, you can give amplifiers, accelerators, and boosters a little more room.

The ongoing bet size: q(i, j) ∙ p(i, j) reads quantity on trade i for stock j at price p(i, j). All those bets are part of the cost matrix (HP) which has for elements: (q(i, j), p(i, j)) on the recorded trade date. Your cost matrix holds all the bets from i to n taken over the life of the portfolio. Another expression for all these bets would be their sum as a vector: Σn (q(i, j) ∙ p(i, j)).

It took 197 pages to explain those variables as they were being built. It would be difficult to describe what they do in a few sentences and out of context. They were added one by one as the development cycle progressed and as it was chronicled in the Quantopian forums.

The objective was to maximize the payoff matrix: Σ (H∙g(t)∙ΔP) where g(t) is this generalized function which we try to master.

I go for g(t) as an exponential function, giving for payoff matrix: Σ (H∙(1 + g(t))t∙ΔP). It should, at least, outperform market averages over the long term: Σ(H∙(1 + g(t))t∙ΔP) > Σ(H_(spy)∙ΔP). But that is my choice. Someone else might like it more subdued or be even more aggressive. That would be their choice.

The point is: trying to control the where you want to go by managing the ongoing inventory while trading over some core positions and using the generated profits to increase the number of trades and bet size. You create this positive feedback loop which will have an impact from start to finish on your portfolio since every penny you make will be reinvested.

Because these variables are compounding, it will accelerate the performance of your portfolio to the point that your equity line will come to display its constructed, restructured or reengineered exponential nature.

You could already design your objectives using the portfolio equation: F(t) = F0 ∙ (1 + g(t))t from which you can extract the needed CAGR to get there: CAGR = (F(t) / F0)(1/t) -1. It is up to you to design your trading strategy to get there.

You need to design the functions in between, modulate them to market swings and make sure that your bet size is growing as your portfolio grows. The long equation in my last post should help give you ideas. There is a multitude of ways of doing this.

Regardless, you could start where I did, that is without those controlling functions. This would reduce the equation to:

q(i, j) ∙ p(i, j) = F0 ∙ (1 + rm )t / max(j)

where F0 is your initial capital, rm is the average market return and max(j) is the number of stocks in your portfolio. Even as a reduced equation, it still suggests to make your bet size grow at the same rate as the average market. And because of max(j), you are in a fixed fraction of portfolio trading environment which will assure scalability.


Created. July 7, 2019, © Guy R. Fleury. All rights reserved.