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


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:

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))

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


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.

###auto correlation in price
r =rep(seq(1,20,1),20)
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)))
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))
  • $\begingroup$ Although there is some evidence of momentum on intraday returns, the strong evidence of momentum is on the typical strategy 6/0/1, i.e. 6 month estimation window, skip one month, 1 month holding period. See Jegadeesh and Titman (1993) or Asness, Moskowitz, and Pedersen (2013). In fact, in short horizons often returns to individual stocks are negatively correlated (see Campbell, Lo and Mackinlay), so you might lose money on that strategy. $\endgroup$
    – phdstudent
    Aug 14, 2015 at 18:41
  • $\begingroup$ Thanks - I am using this to trade. I am using this momentum number as an indicator of market conditions. And will use it post-trade. Any ideas on how to do a 1/2 momentum indicator for a single stock? $\endgroup$
    – joesyc
    Aug 14, 2015 at 21:00
  • 2
    $\begingroup$ Sorry not sure I understood your question... $\endgroup$
    – phdstudent
    Aug 15, 2015 at 8:29
  • $\begingroup$ I'll try and find time to provide an answer to this in the next few days. In the meantime, you might want to edit the question to indicate you are actually talking about autocorrelation in returns, not prices (you had me very confused for a few minutes there). $\endgroup$ Aug 16, 2015 at 23:47
  • $\begingroup$ @Colin T Bowers Please see my note. Thank you. $\endgroup$
    – joesyc
    Aug 17, 2015 at 16:31

1 Answer 1


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).




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.