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 (**H**∙**P**) 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) = F_{0} ∙ (1 + g(t))^{t} from which you can extract the needed CAGR to get there: CAGR = (F(t) / F_{0})^{(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)} = F_{0} ∙ (1 + r_{m} )^{t} / max(j)

where F_{0} is your initial capital, r_{m} 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.