rd.get_history returns duplicated datapoints

Hi all,

Can someone help me with those requests which returns duplicated datapoints ?


Request 1

import refinitiv.data as rd
rd.open_session()
res = rd.get_history(universe=["ESH2^2"], fields=["TR.CLOSEPRICE"], parameters={ "SDate": "2020-12-18", "EDate": "2023-03-18"}, use_field_names_in_headers=True)


Response

The last datapoint is duplicated several times

1683913932773.png



Request 2

import refinitiv.data as rd
rd.open_session()
test = rd.get_history(universe="SRAK3",
              fields=["TR.CLOSEPRICE","TR.SETTLEMENTPRICE","TR.OPENINTEREST","TR.HIGHPRICE","TR.LOWPRICE","TR.ACCUMULATEDVOLUME"],
              parameters={"SDate": "2023-02-03", "EDate": "2023-08-25"},
              use_field_names_in_headers=True)


Response

Inspecting by hand it shows that one line has the full information, where the ‘duplicated’ one have some missing field (and is not necessary the last line with that date, eg the 6th of march)

1683914086589.png



Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    The resolution is:

    Actually, this is the behavior of the service. It is expected to use the previous date to fill the date which doesn't have data. To solve this problem please use the Fill=None parameter, as shown below.

    =@RDP.Data("ESH2^2","TR.CLOSEPRICE.date;TR.CLOSEPRICE","SDate=2020-12-18 EDate=2023-03-18 Fill=None CH=Fd RH=IN",B2)

    =@RDP.Data("SRAK3","TR.CLOSEPRICE.date;TR.CLOSEPRICE;TR.SETTLEMENTPRICE;TR.OPENINTEREST;TR.HIGHPRICE;TR.LOWPRICE;TR.ACCUMULATEDVOLUME","SDa"&"te=2023-02-03 EDate=2023-08-25 Fill=None CH=Fd RH=IN",W2)

Answers