question

Upvotes
Accepted
43 2 4 8

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



#productapi#contentrefinitiv-data-platform-librariescodebook
1683913932773.png (24.6 KiB)
1683914086589.png (72.0 KiB)
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.

<AHS>

Raising a content ticket via MyRefinitiv

@yaokoffi.kouassi

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

Upvotes
Accepted
78.9k 250 52 74

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

Upvotes
14.2k 30 5 10

Hi @yaokoffi.kouassi ,

The moderators on this forum are expertise on Refinitiv APIs usage. However, they do not have deep expertise in every type of content available through Refinitiv products. Such expertise is available through Refinitiv Helpdesk, which can be reached via MyRefinitiv. To be of help, ticket number 12564679 was raised on your behalf and the support team is going to contact you soon to assist with this.

Hope this helps and please let me know in case you have any further questions

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.

Upvotes
3 0 1 4

According to the (very scarce) documentation Fill=None is not an option in the python api.

Besides Error 400 and 500 happening randomly and the oddest behavior in general, has anybody cracked rd.get_history so the it actually works?

I am tearing my hair out ...

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 @the.swiss

Hope you are doing well.


Fill=None is well an option for get_history.

For instance, the code below with Fill=None option is the following one:


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", "Fill": "None"},
               use_field_names_in_headers=True)


Upvotes
3 0 1 4

cool thanks, will try tomorrow

Can you then point me to a better documentation for RD than what I found so far?

https://cdn.refinitiv.com/public/rd-lib-python-doc/1.0.0.0/book/en/sections/access-layer/access/get-history-function.html

Cheers

Alfred

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.