I took daily adjusted close prices (all history) from Yahoo Finance and ran the following code:

import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
spy['Date'] =  pd.to_datetime(spy['Date'], infer_datetime_format=True)
spy["LogRet"]=np.log(spy["Adj Close"]).diff()
pd.plotting.autocorrelation_plot(spy.LogRet[1:],ax= plt.gca(xlim=(1, 10), ylim=(-.1, .1)))

enter image description here

It appears the daily log-returns are autocorrelated past the 99% significance level. Did I mess up? Or if this is true, then why does such a simple stat-arb opportunity exist?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.