For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
20 2 1 5

Does the Eikon API provide the capability to correlate two equity instruments?

The Eikon terminal can correlate two stocks. Is this same capability abvailable through the Eikon Data API?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
6.7k 8 6 7

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.


1595326122201.png (22.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
20 2 1 5

Jason, thank you very much for your prompt response. And the Python (Eikon API pandas dataframe) example.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea