question

Upvotes
Accepted
1 1 1 3

Multiple prices for the same RIC and date

Hello,

I'm working with Brazilian date and found that for some stocks, when I retrieve the price date, the query returns multiple lines for the same date. Is this because my date field is based on TR.PriceClose (i.e.,TR.PriceClose.Date)?

Here is the code (FYI, this RIC is an equity forward. The underlying is PETR4.SA)


fields = [{'TR.CLOSEPRICE(Adjusted=0)': {'Curn': 'BRL'}},
          {'TR.CLOSEPRICE(Adjusted=1)': {'Curn': 'BRL'}},
          'TR.PriceClose.Date']

params = {'SDate': '2012-01-04', 'EDate': '2020-12-30', 'Frq': 'D', 'CH': 'Fd'}
df, e = ek.get_data(instruments = ['PETR4S.SA'], fields=fields, parameters=params)

df[df['Date'] == '2012-09-14T00:00:00Z']

df[df['Date'] == '2012-09-14T00:00:00Z'].drop_duplicates()


It returns the following:

1703009561833.png

Note that after removing duplicates, we have multiple prices for the same date.

Thank you in advance.

#contentpython apiprice-history
1703009561833.png (71.5 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.

Upvotes
Accepted
15.6k 33 5 10

Hi @p.saffi ,

Thank you for posting the question in this forum. However, this forum is dedicated to an API usage question hence, the moderators on this forum 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 13183814 was raised on your behalf and the support team is going to contact you directly 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
15.6k 33 5 10

Hi @p.saffi ,

The duplicate rows are from different Calc Date and Period End Date, you can check available parameters of the field in Data Item Browser > Parameters tab > Output dropdown

1703059332773.png

Here's the result of every parameters available of TR.CLOSEPRICE

1703059285162.pngAlso, are there any specific reason to use date from TR.PriceClose? It's recommended to use date from the same field as the close price instead as it's the same set of the data


1703059332773.png (76.1 KiB)
1703059285162.png (63.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.

Upvotes
1 1 1 3

Thank you @raksina.samasiri. Why does using a different CalcDate and PeriodEndDates change the answer here? For instance, in row 2220 of the ic you sent last, for Date 2015-05-27, we have calcdates in 2020-12-22.

I have stopped using TR.PriceClose.date and started using the one for ClosePrice. Would you recommend using TR.ClosePrice.Timestamp as the main "date" variable instead?


Thank you again,

Pedro

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.