Python API get_timeseries returning values

Hi,

I want to get historical prices of "WIPLNOND=" and "PLN6X12F=" instruments. The "get_data" function works fine, but it returns only one record. In this case I tried "get_timeseries" function, but it returns <NA> values. I've checked instruments fields in Data Item Browser and TR.ASKPRICE / TR.MIDPRICE are available in Time Series and are not blank.

My code:

df, err = ek.get_data("PLN6X12F=",["TR.MIDPRICE", "TR.MIDPRICE.Timestamp"])
df = ek.get_timeseries("WIPLNOND=",fields=['TR.ASKPRICE', 'TR.ASKPRICE.Timestamp'])
df = ek.get_timeseries("PLN6X12F=",["TR.MIDPRICE", "TR.MIDPRICE.Timestamp"], interval='hour')

Output (example):

1626090203728.png

1626089903750.png

I've checked similar forum questions like this, but couldn't find a solution. How should my "get_timeseries" input look like?

Best Answer

Answers

  • Hi @rafal.belka

    Alternatively, you can use RDP Library.

    Please try the code below:

    ahs1.png

    You can use help(rdp.get_historical_price_summaries) to see the function-supported parameters such as start, end, fields, count, etc...