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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonconstituentsetf
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.

Upvote
Accepted
23k 22 9 14

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 5.0 MiB each and 10.0 MiB total.

Upvotes
6.7k 8 6 7

@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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea