question

Upvotes
Accepted
11 4 4 8

Workspace codebook to get historical data of PB PE and PS

客户用workspace code book取nasdap股票的历史数据PE PB和PS,sample aapl.o

客户找不到合适的API example,麻烦可不可以协助提供sample code

workspace-data-api
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.

@chavalit-jintamalit Hi chavalit, could you help on this ticket? Thanks.

Hello @Hao.Tang

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

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

Thanks,
AHS

1 Answer

· Write an Answer
Upvotes
Accepted
79.2k 251 52 74

@Hao.Tang

Thanks for reaching out to us.

You can use the get_history method in the RD library to retrieve historical data of PB, PE, and PS.

The code looks like this:

rd.get_history(universe="AAPL.O", 
               fields=["TR.PE","TR.PriceToBVPerShare","TR.PriceToSalesPerShare"], 
               interval="1D", 
               start="2020-01-01", 
               end="2020-02-01")

The output is:

1664357745694.png

You can also refer to the Access__Get_History.ipynb example in 01.01. Refinitiv Data Library.

1664357822263.png

Please feel free to reach out if you have any further questions.


1664357745694.png (35.4 KiB)
1664357822263.png (10.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.

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.