0
$\begingroup$

I am trying to reproduce the analysis discussed in https://arxiv.org/pdf/cond-mat/9905305.pdf where they use high-frequency data (1minute thick) of S&P500 from 1984 to 1996.

In particular, I want to reproduce their Fig. 2(a) showing the autocorrelation of returns, and to see the exponential decay I really need the entire database.

What is the easiest way to access these high-frequency data?

I have a subscription to TradingView but the amount of high-frequency data is really limited. For example, today I can download 1minute data back to 8 days ago. If I use these data and try to compute the autocorrelation with python with the following code, I don't get the exponential decay of the autocorrelation: I need more data clearly.

My python code is

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

df = pd.read_csv('SP_SPX, 1.csv',parse_dates=['time'],index_col='time',skipinitialspace=True)
df=df.reset_index()
df['time'] = pd.to_datetime(df['time'],utc=True)
df=df.set_index('time')

logDataSet=np.log(df)
logDataSetDiff = -logDataSet.diff(periods=-1)
logDataSetDiff=logDataSetDiff.iloc[2:50]

y=[]
for i in range(0,len(logDataSetDiff)-1):
    y.append(logDataSetDiff['close'].autocorr(i))

x=range(0,len(y))

plt.scatter(x, y)
plt.yscale('log')
plt.show()

and the file SP_SPX, 1.csv can be downloaded here https://pastebin.com/jkPWQzjf

I get the following autocorrelation

enter image description here

$\endgroup$
6
  • $\begingroup$ High frequency index data can be purchased from a vendor. 1983 to Present: tickdata.com/historical-market-data-products/cash-indices/… 2007 to Present: backtestmarket.com/en/sp-500-1m firstratedata.com/i/index/SPX No guarantee or endorsement implied. $\endgroup$
    – nbbo2
    Dec 17, 2021 at 17:31
  • $\begingroup$ @noob2 thank you. Do you know what is the average price for such a database? $\endgroup$
    – apt45
    Dec 17, 2021 at 17:33
  • 1
    $\begingroup$ You could also try CQG Data Factory. They have data back to 1982 for full-size S&P 500 futures. Appreciate you mentioned SPX but consider this a 'substitute good'. $\endgroup$
    – user42108
    Dec 17, 2021 at 18:12
  • $\begingroup$ Futures are a traded asset so they could actually be a superior alternative in some ways. $\endgroup$
    – nbbo2
    Dec 17, 2021 at 20:44
  • $\begingroup$ If you are satisfied with only 2010-Present and are willing to download multiple files you can get SPX one minute data free here histdata.com/download-free-forex-historical-data/?/excel/… That is the best deal I know about $\endgroup$
    – nbbo2
    Dec 17, 2021 at 21:15

0

Your Answer

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