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

Rhistory to Python

I have a question concerning the conversion of Rhistory code in the Excel formula builder to Python. This is a question that has returned on this forum, but I have thusfar not been able to use the answers to translate the output to those answers to a useful thing for me. For full openness: I am not using Python (due to company policy) but the Eikonapir package in R, but I know how to translate the Python commands to R and hence should know how to proceed once I get the Python code correct.

Specifically, I have the following formula in Excel

=RHistory("DE201116775=";"ASK.Timestamp;ASK.Close";"START:01-Jan-2022 END:17-Mar-2023 INTERVAL:1D";;"TSREPEAT:NO CH:Fd";B2)

My attempts at translating this to Python, take following form:

ek.get_timeseries('DE201116775=',
                  fields=['CLOSE'],
                  start_date='2022-01-01T00:00:00',
                  end_date='2023-03-17T00:00:00
                  interval="daily")
#product#contentpython apiexcel
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.

Hi @koen.breemersch ,


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 most 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

1 Answer

· Write an Answer
Upvotes
Accepted
5k 16 2 7

Hi @koen.breemersch ,


Thank you for your question.

The following code which utilizes our latest RD Library returns the data for me:

df= rd.get_history('DE201116775=',
                  fields=['BID','ASK'],
                  start='2022-01-01T00:00:00',
                  end='2023-03-17T00:00:00',
                  interval="daily")
df

You may also, skip the fields to see available default fields

screenshot-2023-03-20-at-180054.png


Hope this helps. Please let me know should you have any further questions.


Best regards,

Haykaz


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.