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")

Best Answer

  • aramyan.h
    aramyan.h admin
    Answer ✓

    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