# When measuring autocorrelation should you use log returns or prices?

Let's say you want to measure intra day autocorrelation from 9:30 am to 1pm using 5-minute prices should you calculate the autocorrelation using raw prices or log returns (i.e. diff(log(prices)))? Can you explain?

Below is an example showing using price recognizes high serial autocorrelation in the price while log returns does 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 #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   #this DOES NOT recognize the price dynamics of high serial correlation for runs of 20 at a time
arima(r, c(1,0,0))