## Stock Investing And Trading Are Not The Same Game¶

Investing in stocks and trading them are not the same, even if both are played using the same stocks. It is as if anyone could design their own game within the game to suit their own perceptions and objectives, that they be short-term or long-term. All could call it their investment strategies, and technically they are right. Furthermore, they could all win.

However, most often than not, the majority does not even outperform market averages over the long-term, no matter the game they played, almost.

Here is a very basic question:

If you cannot predict tomorrow's price or next week's for that matter, why play as if you could?

And, it raises another question for the trader: what is the nature of what you intend to play with?

### Profit or Loss¶

The profit or loss from a single stock trade is simple math: $q \cdot (p_{out} – p_{in}) = \pm x$. It could also be expressed in many ways, for example, integrals: $\int_0^t q \cdot dp = q \cdot p_t |_0^t = q \cdot (p_{t} – p_{0}) = \pm x. \,$ If you wanted only the $+ x$ side of the outcome, you would need to make a prediction and be right about it. You would need: $p_t – p_0 > 0$, or more succinctly: $\Delta p > 0$. Evidently, if $\Delta p < 0$, you have a loss.

We could also describe a price series as a stochastic price function having the form: $p(t) = \mu dt + \sigma dW$ having the trend or regression line $\mu dt$, and a Wiener process $\sigma dW$.

Subtracting the trend would leave only the random-like part of the price movement often referred to as the residual or error term gives: $p(t) = \mu dt + \sigma dW - \mu dt = \sigma dW$. The residual is the error term in a linear regression: $f(t) = a \cdot x + \Sigma \epsilon$. The sum of the error terms tend to zero: $\Sigma \epsilon \to 0$.

The following chart shows the first 40 bars of a 30,000-bar of a randomly generated price function: $p(t) = \sigma dW$.

Fig. 1 $\;$ Price Series, First 40 Bars

The particularities of the above chart are: it was all randomly generated (open, high, low and close), making the chart's price movement totally unpredictable from one bar to the next. But where, nonetheless, you could make guesses or bets as to what the price might be for the next bar. And as such, we would all understand such plays as simply gambling.

### Random Price Series¶

The following two charts use the same base price open to which was added randomly changing price variations to the high, low, and close. As if making each chart a what might also have been series. We could make millions of these charts. They would all look somewhat alike, but in neither of them could you successfully find a reliable method of predicting what would be the next bar.

Having done these charts in Excel, pressing F9 repeatedly would generate totally new price series which again would be totally unpredictable. That I make thousands and thousands of these charts, it would not make them more predictable. Even if I add all the statistical data that could be obtained from such an experiment. You know the answer even before doing any tests. There is nothing there to be had as predictive data.

Fig. 2 $\;$ Price Series, First 40 Bars

Fig. 3 $\;$ Price Series, First 40 Bars

### The What Was¶

Looking back at stock prices is like looking at chart 1. There was one occurrence that came out. It would have been 1 in the gazillions of other possibilities. It is only that that was the one that happened first. And therefore, we never saw what could have been any other chart, no matter how many there could have been.

All 3 charts above might be based on the same opening price, but trading decisions would be made based on the previous closing prices which were also unpredictable. Any trading software would not be able to make real sense out of such a chart. To be politically correct, using past data, they could make a lot of assumptions and put all sorts of lines on these charts, but on future data, they could never outguess randomly generated price series such as these except by luck, almost by definition.

### Not Enough Data¶

You could try to predict in other ways. From a 40-bar chart, there is not much you can do. One could say: with so little data, making predictions is not revealing in such cases. We could easily understand why. Not enough data to make anything statistically significant. Especially in a game which is intended to be played for years on end.

So, let's make the data series longer, much longer (30,000 bars). All three charts below were generated using the same method as for the first chart. The first 40 bars of chart 1 originate from chart 4.

Note that for each chart up to 5 factors were extracted: $x^1$ to $x^5$. By adding factors, it increased the coefficient of determination: $\mathsf{R}^2$. It is understandable since each factor in the equations explained more and more of the price series.

We could consider the 3 charts as part of a long-term chart that has been sliced in multiple parts of which only the first 3 charts are shown below.

Fig. 4 $\;$ XYZ Price Series, First 3,000 Bars $\,$ (in sample)

Fig. 5 $\;$ XYZ Price Series, Next 3,000 Bars $\,$ (out of sample)

Fig. 6 $\;$ XYZ Price Series, Next 3,000 Bars $\,$ (walk forward)

### The So What Clause¶

There is a point to all this. Charts 1 to 3 were all unpredictable, even if they had the same opening price series. So are charts 4, 5 and 6. They are all linked to the same price series. Chart 4 is totally unpredictable. Since charts 5 and 6 are continuations of this randomly generated price series, they too are unpredictable.

The same would go for the next 21,000 bars (not shown) of this randomly generated price series. It would remain short-term, mid-term and long-term unpredictable.

No matter what kind of factors you would want to extract, none of them might carry forward. As if saying that your “predictions” are in fact only guesses. Even if no one is stopping you from making those guesses, it does not make them right. It makes them only guesses, nothing more. The reason is simple: there is nothing more than luck to be had.

### Partitioning Data¶

Even if you declared chart 4 as an “in sample” training period, it would not change the unpredictability of that chart or the ones that follow it. Even if you wanted to extend the factor equations to include $x^6$ to $x^{11}$, it would not change the unpredictability you would find at the right edge of the charts as shown in chart 5 (the continuation of chart 4), or the right edge of chart 5 or 6, for that matter. Each bar of this 30,000-bar series would remain unpredictable by construction.

There is nothing exceptional in all these charts. They do resemble actual stock prices that have been detrended, meaning that their respective regression lines have been removed, and yet, they still retain one on the random-like price behavior. Even on a Wiener process, you can extract multi-factor equations with as many factors as you want.

Even so you can extract factors from charts 4, 5, and 6, none of them could be of use in implementing any type of worthwhile trading strategy where you could say, in advance, that it would win the game. And not be something entirely due to luck. Just pressing F9 on this Excel spreadsheet would generate a totally new price series with new factor equations.

A trading strategy is the sum of the outcome of all trades. This is easily expressed: $\sum_1^n ( q_i \cdot \Delta ^i p_i)$ where all trades are sequentially number from $i = 1, \dots, n$ and then added to make the total profit or loss. On a long-term randomly generated price series, the payoff should be expected to tend to zero: $\mathsf{E}[ \sum_1^n ( q_i \cdot \Delta ^i p_i)] \to 0$. The same outcome as if playing a heads or tails game. You could literally make thousands and thousands of trades and still have a long-term zero expectancy. Not the most desired outcome for all the efforts put in the game.

There is so much one could say about the above charts, but also so much no one wants to hear.

For instance, designing trading strategies around randomly generated data series is a lot more demanding that one might think. From the start, you will be told that the expectancy is zero, and yet, some will still forge ahead. For what reasons, I do not know. Or they will come up with so many different ways of looking at the data and declare they can see patterns, Fibonacci sequences, or what have you. All of it will just be gibberish, and for cause. Those charts were randomly generated after all.

Notwithstanding, there are patterns in randomly generated prices. You will find flags, pennants, head and should stuff, wedges and all. But, overall, they will not be useful in helping you make trading decisions that will be better than luck. How could they? From any one bar in that 30,000-bar price chart, there is no assurance that if you started a trade right there that there would be a profit, none whatsoever.

We should understand that nothing will give you an edge except pure coincidence which translates to you made a guess and you got it right or you got it wrong, the same as if you had flipped a coin. There is no machine learning program either or deep learning one for that matter that has shown they could outperform the game of heads or tails with any consistency. All they could rely on is that sometimes they had some luck, and at other times they did not.

### The Long-Term Trend¶

Over the short term, everything above prevails. The more it resembles a random-walk.

It is by putting the left-out trend $\mu dt$ back in that you can give these trading strategies something. In a way declaring that the game is not a martingale, that stock prices do have memory (long-term trends), that you can design profitable trading strategies with a much higher expectancy than zero. In fact, you could design strategies with an "almost surely" mathematical positive expectancy, as long as you played the game with a long-term vision of the game.

$©$ 2018 September. Guy R. Fleury