Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
20 3 2 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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
icon clock
10 |1500

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

Upvotes
Accepted
10.2k 18 6 9

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 512.0 KiB each and 1.0 MiB total.

Upvotes
20 3 2 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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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