How to prove that a stock's price deviation from its moving average is a mean reversion process?

145 Views Asked by At

If you build a moving average from stock price values, then the price graph fluctuates around this moving average. How can one mathematically prove that a price's deviation from its moving average is a mean reversion process?

If $x_{t}$ - price at moment $t$,

Exponential Moving Average (EMA): $y_{t}=(1-\alpha )\cdot y_{t-1} + \alpha \cdot x_{t};\ \ where\ \alpha = Const, 0 < \alpha < 1$

or Simple Moving Average (SMA): $y_{t}=\frac{1}{k}\cdot \sum_{i=0}^{k-1}x_{t-i}$

Price deviation from its moving average: $s_{t}=y_{t}-x_{t}$

UPDATE: While discussing with @Henry I realized the ambiguity of my question, because... I meant mean reversion as it is defined in finance:
"Asset's price will tend to converge to the average price over time"
So it is enough to prove that this process is autoregressive (AR(1) with autoregression coefficient $0 < \varphi < 1$), which is what I did in one of the drawings for an exponential moving average. But I haven’t succeeded yet with the proof for a simple moving average...

2

There are 2 best solutions below

0
On

Proved for EMA:

$$ s_{t}=y_{t}-x_{t}=\\ (1-\alpha )\cdot y_{t-1} + \alpha \cdot x_{t}-x_{t}=\\ (1-\alpha )\cdot s_{t-1} + (1-\alpha )\cdot x_{t-1}-(1-\alpha )\cdot x_{t}=\\ (1-\alpha )\cdot s_{t-1} - (1-\alpha )\cdot (x_{t}-x_{t-1})=\\ (1-\alpha )\cdot s_{t-1} - (1-\alpha )\cdot \epsilon_{t}\\ \\ \\ \\This\ is\ a\ formula\ for\ auto-regression\ AR(1)\ model,\ and\\ since\ (1-\alpha )<1\\ and\ assuming\ \epsilon_{t}=x_{t}-x_{t-1}\ is\ white\ noise, \\ \Rightarrow s_{t}\ is\ \mathbf{mean\ reversion\ process} $$

6
On

This is not "mean reversion": the price changes are presumably independent of what has happened before and assumed to be a homogeneous Markov process so the price level is a random walk.

Knowing the current moving average and current price level tells you nothing about future price changes.

Instead, what happens is that the moving average of the recent past moves towards the current price level as more distant price levels (further from the current price level) fall out of the average and more recent price levels (close to the current price level) are included in the average.

Here is a simulation in R to illustrate this:

set.seed(2023)
changes <- rnorm(65,0,1)
plot(changes)

which shows the $N(0,1)$ price changes enter image description here

Let's apply this to a starting level of $1000$ to give a time series of price level and then subtract the simple moving average of the $5$ most recent values. It appears to oscillate around $0$, and thus might appear to suggest some kind of mean reversion:

level <- cumsum(c(1000,changes)) 
ma <- function(x, n){stats::filter(x, rep(1 / n, n), sides = 1)} 
simplema <- ma(level, 5) 
plot(level-simplema) 
abline(h=0)

enter image description here

But if you look below at the actual price levels (black) and the moving average (red), you can see it is the moving average which tends to move towards the price level rather than the other way round, particularly noticeable in this simulation between $40$ and $50$.

plot(level, type="b")
lines(simplema, col="red")

enter image description here