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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
166 10 17 21

Eikon API: how to get the right calcdate for TR.PEG?

Question on behalf of a client. Client would like to calculate the historic TR.PEG for NSI (RIC: NSTEc.AS). The following code gives the wrong output for calcdate. Therefore, it is not clear for which this date this TR.PEG applies. Can anyone help out please? Thanks!

start_date = str(20161231)
end_date = str(20170301)

my_symbol = "NSTEc.AS"

data, error = eikon.get_data(my_symbol, ["TR.PEG", "TR.PEG.calcdate"], {"SDate":start_date, "EDate":end_date})

data

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.

1 Answer

Upvotes
Accepted
39.2k 75 11 27

This issue has been previously raised here. The workaround is to swap the values of SDate and EDate, i.e. ensure that SDate>EDate.

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.

Thanks Alex, you are right. Your workaround works. My apologies I didn't see your answer on Jan's post. Please note that searching for "calcdate" in the forum doesn't return Jan's question. Does the search function also search in the body of the questions?

calcdate.jpg

calcdate.jpg (75.5 KiB)
Click below to post an Idea Post Idea