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
1 0 1 2

ETF constituent movers on a list of dates

Given a list of dates, I want the individual returns for each of the constituents of an ETF (for each of those dates)

eikoneikon-data-apirefinitiv-dataplatform-eikonworkspaceworkspace-data-apiconstituentsetf
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.

Hello @arun.sharma3 ,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

-AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

Upvote
Accepted
32.2k 40 11 20

Hello @arun.sharma3,

Reviewing this previous discussion thread may be helpful with the approach to obtaining this result set.

Next I would tweak/tune the approach to your requirements, and Data Item Browser tool can be helpful to look up available Returns for your target ETF constituents and tune the request:

dibetfreturns.gif

Therefore, a request similar to:

# obtain constituents at date
df, err = ek.get_data('RPV',['TR.ETPConstituentRIC','TR.ETPConstituentWeightPercent'],{'SDate': '2017-01-03'})
# create a list of constituents at date
list(df['Constituent RIC'])
# request returns per list
df, err = ek.get_data(list(df['Constituent RIC']),['TR.TotalReturn','TR.TotalReturn1Wk'],{'SDate': '2017-01-03'})
df

Would result in:

return.gif

And if you require this for a list of dates you would run the tuned request per each required date to obtain the results for the date.

Hope this information helps


dibetfreturns.gif (203.1 KiB)
return.gif (62.2 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
10.2k 18 6 9

@arun.sharma3 Please see the following:

dates =['2021-11-01','2021-10-01']
df = pd.DataFrame()

for date in dates:
    cons, err = ek.get_data(['ISF.L'], ['TR.ETPConstituentRIC.calcdate',
                                        'TR.ETPConstituentRIC',
                                        'TR.ETPConstituentName',
                                        'TR.ETPConstituentPrice'],
                                    parameters={'SDate': "'" + date + "'"})
    if len(df):
        df = pd.concat([df, cons], axis=0,ignore_index=True)
    else:
        df = cons

df

1636479743314.png


I would then get the daily returns separately as Zoya has described above. I hope this can help.


1636479743314.png (200.5 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.

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.