Skip to content
All library documents

Using Autocorrelation Statistics to Measure Intraday Momentum

Article Quant Q&A · Author: joesyc

Summary

The document considers simple ways to summarize stock-price momentum from the market open to a trade time for post-trade analysis. One proposal fits an AR(1) model to log returns and uses its coefficient, which under standard estimation is essentially the sample first-lag autocorrelation. Another proposal uses the Ljung–Box test across several lags. The response favors the test statistic as a broader summary because it combines autocorrelation across lags rather than focusing on the first lag alone.

The choice of sampling frequency is a key limitation. At very high frequencies, measured dependence may reflect market microstructure effects such as bid-ask bounce rather than momentum; midpoint returns may help reduce that influence. The response cautions that separating microstructure-driven correlation from momentum can be difficult at frequencies above roughly fifteen minutes, depending on liquidity. The discussion does not establish a universally accepted momentum measure, and a test statistic should not be confused with its p-value when constructing a daily metric.

Key ideas

  • An AR(1) coefficient on returns is essentially a measure of first-lag autocorrelation.
  • A Ljung–Box statistic summarizes autocorrelation across multiple lags.
  • High-frequency return dependence may capture bid-ask bounce and other microstructure effects.
  • Using bid-ask midpoint returns may reduce some transaction-price microstructure noise.
  • The appropriate frequency depends on liquidity, and no universal momentum definition is established.

Tags

Full text
# Measuring momentum as AR(1) process


# Measuring momentum as AR(1) process












I would like to measure the momentum in the price of a stock from the time the market opens until the time I trade each day. I want to use this momentum number in post-trade analysis (regression of trading cost and performance, etc...) I know there is no universally accepted definition for momentum and I need this momentum calculation to be consistent and hopefully simple so I was thinking defining momentum as the amount of autocorrelation in the time series where the autocorrelation is measured by the AR(1) coefficient

METHOD 1

An AR(1) process Y is defined as

$ y_t = c + \beta y_{t-1} + \epsilon_t $

where $ \epsilon_t $ is white noise and

c is a constant.

If the absolute value of beta $ |\beta| $ is >= 1 then shocks accumulate over time and the process is nonstationary. If beta $ |\beta| $ is < 1 then the process is stationary

As an example in R here is the SPY modeled as an AR(1) for 200 days. The prices below are daily prices but I will be using 1-minute or 5-minute prices:

```
require(quantmod)
getQuote("SPY" )
URL <- "http://ichart.finance.yahoo.com/table.csv?s=SPY"
dat <- read.csv(URL)
dat$Date <- as.Date(dat$Date, "%Y-%m-%d")
n= 200 #number of prices
logret = diff(log(dat$Close[1:n]))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
arima(logret, c(1,0,0))
plot(logret,type="l")
```

The AR(1) coefficient is -.02 and I would this -.02 as my measure of momentum.

METHOD 2:

My other approach was to be even more simplistic and to just test IF there is any autocorrelation at all using the Box.test which would say if the autocorrelations are all zero.

```
Box.test(logret, lag=15, type = 'Ljung')
```

in this case the p-value = .93 so there is no autocorrelation for lags 1...15 so I was thinking of using this Box.test p-value as my measure of momentum.

Can you comment on these methods? Which one is better or do you have suggestions? Again I am looking for something consistent and simple. I do not want to estimate the "best" time series model for each trade because each trade the preceding time series might be an AR(1) one day but an ARIMA(2,0,5) another day.

NOTE: Above I am using LOG RETURNS in the fitted AR(1) model and the Box.Test. I am doing this to perform the calculations on a stationary time series. But is it acceptable/preferred to perform these tests on raw prices?

As an extension of weather to use Price or log returns: Below is an example showing using price recognizes high serial autocorrelation in the price while log returns do not recognize it.

```
set.seed(12345)
###auto correlation in price
r =rep(seq(1,20,1),20)
plot(r,type='l')
acf(r, lag.max= 1)$acf # .72 = this DOES recognize the price dynamics of high serial correlation for runs of 20 at a time
arima(r, c(1,0,0))

### autocorrelation in log returns
r =diff(log(rep(seq(1,20,1),20)))
plot(r,type='l')
acf(r, lag.max= 1)$acf   # -.15 = this DOES NOT recognize the price dynamics of high serial correlation for runs of 20 at a time
arima(r, c(1,0,0))
```

## Answer by Colin T Bowers (score 1)

https://quant.stackexchange.com/a/19392

It is not entirely clear what you're after, since Method 1 from the question is a statistical model, while Method 2 is a statistical test.

From the initial question, I'm going to make the assumption that what you're actually after is some number that summarises "momentum" on a given day. If this is the case, I would weakly prefer the Ljung-Box test statistic (using, say 10 lags of the autocorrelation coefficient) as my metric, over the estimated coefficient from an AR(1).

The reason for this is that under standard estimation procedures, the estimated AR(1) coefficient is just the sample first order autocorrelation coefficient, so this is a pretty simplistic metric for momentum effects.

In contrast, the Ljung-Box statistic is just a sum over the autocorrelation coefficients and so reflects a wider range of possible structures of the autocorrelation function. Given that, as you say, there is no agreed upon definition of "momentum", the greater flexibility in the Ljung-Box approach seems preferable.

Of course, you'll need to be very careful about what frequency of log-returns you are using. If the frequency is too high, then your statistic will actually be a measure of the magnitude of microstructure effects such as bid-ask bounce, rather than a measure of momentum. You could potentially mitigate this somewhat by looking at log-returns in a series like the bid-ask midpoint instead of the transactions series.

As a general comment though, I suspect that you'll have great difficulty separating out correlation induced by microstructure and correlation induced by momentum at any frequency higher than about 15 minutes (of course, it depends on how liquid the underlying asset is).

Cheers,

Colin

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.