The Eikon terminal can correlate two stocks. Is this same capability abvailable through the Eikon Data API?
For a deeper look into our Eikon Data API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials | Articles
The Eikon terminal can correlate two stocks. Is this same capability abvailable through the Eikon Data API?
Hi @mark.ringrose thanks for your question. At present we do not expose the capability to correlate two stocks via API - though we are expanding our calculated analytics all the time and this is a pretty common ask. However, it is a pretty trivial operation in python. For example if you want a correlation (taking stationarity into account):
# download daily closing price data for pair df2 = ek.get_timeseries(['F','TSLA.O'], fields='CLOSE', start_date='2015-03-01',end_date='2020-04-26',interval='daily') # calculate daily returns rets = np.log(df2 / df2.shift(1)).dropna() # Correlate daily returns rets.corr()
I hope this can help.
Jason, thank you very much for your prompt response. And the Python (Eikon API pandas dataframe) example.