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
166 13 18 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-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.

1 Answer

· Write an Answer
Upvotes
Accepted
39.4k 77 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 512.0 KiB each and 1.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)

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.