Module 1 · Demystifying Time Series Data and Modeling

Six Charts, One Real

One of these six charts is a real price history. The other five are fakes: the same daily moves, in a shuffled order. Which one is real? Take a moment. Look for the real rallies and the real crashes. Then see what that says about forecasting a stock price.

Goes with Deep Forecasting, Module 1, Part 4: can a model beat Wall Street?

Market

How the fakes are made

Take the real daily moves, about 1,500 of them, and shuffle their order. Same moves, different order. That is why every chart starts and ends at the same price. Shuffle a sentence and the meaning is gone. Shuffle the airline passengers and the trend and the seasons are gone. Shuffle these, and you cannot tell.

The daily moves

Be careful with your eyes

People see patterns in charts. Support lines, where a falling price seems to bounce. Resistance lines, where a rising price seems to stall. Technical analysis is built on them. Here is a stretch of the real Apple chart, and a stretch of one of the shuffled fakes.

Do the daily moves remember anything?

If a price is a random walk, today's move tells you nothing about tomorrow's. Then the autocorrelation of the daily returns at lag 1 should be 0. Here it is for 7 markets.

Today's move against tomorrow's lag 1 autocorrelation of daily returns

What is really there

After a wild day-the average size of the next day's move
After a calm day-the average size of the next day's move

The size of tomorrow's move is partly predictable: wild days follow wild days. Its direction is not. Careful studies also find momentum over months and small reversals over days. So prices are not perfectly random. But the market is efficient enough to make those pockets very hard to exploit.

The test: can a model beat "tomorrow equals today"?

7 markets, 2 test years, 3 models. Each model sees the last 5 daily returns of one market and forecasts the next one: Tx is 5, Ty is 1. One step ahead, the easiest horizon there is. A green cell means the model beat the naive forecast in that test.

And if you do beat it: the win rate is not the measure

Suppose your model does beat the naive forecast. Now you have to trade on it, and that is a different game. Here is the classic mistake: a system that wins 80 percent of its trades.

Won, out of 100 trades-
Lost-
You end up-

1 · A random walk

The path of someone who takes every step in a random direction, with no memory of the step before. After 10 steps he is somewhere near where he started. After 1,000 he could be anywhere. And at any moment, the best guess for where he will be after his next step is: right where he is now.

2 · Why the naive forecast is so hard to beat

If tomorrow's price is today's price plus a random step, nothing in the past improves on today's price. And if everyone knew a stock would rise tomorrow, they would buy it today, and it would rise today. So only news moves prices, and news is what you could not predict.

3 · Somewhere in the middle

Prices are not perfectly random. There are pockets of predictability and temporary trends. But a pattern that is easy to see gets traded on, and trading on it makes it disappear. For most purposes a random walk is a reasonable approximation.

4 · Where to point the crystal ball

Demand, sales, energy, traffic, weather: most business series live much closer to the airline passengers than to Apple. To play with the random walk itself, its drift and its widening band, see The market random walk. For the benchmark at longer horizons: Beat the benchmark.