The instrument issue when I fetch historical PE ratio of SPX constituents

I use the following statement to fetch historical PE ratios of SPX constituents.
rcc, err=ek.get_data("0#.SPX(2002-08-09)",fields=["TR.RIC","TR.InstrumentDescription", "TR.RIC.date"])
instruments=rcc['RIC'].tolist()
df,err=ek.get_data(instruments, ['TR.PE', ‘TR.PE.date'], {"SDate": "2002-08-09", "EDate":"2002-08-09"})
Below is the message from Spyder.
File "C:\Users\xxx\Anaconda3\lib\site-packages\eikon\data_grid.py", line 189, in get_data
result = eikon.json_requests.send_json_request(_endpoint, payload, debug=debug)
File "C:\Users\xxx\Anaconda3\lib\site-packages\eikon\json_requests.py", line 127, in send_json_request
_check_server_error(result)
File "C:\Users\xxx\Anaconda3\lib\site-packages\eikon\json_requests.py", line 203, in _check_server_error
raise EikonError(int(server_response['ErrorCode']), error_message)
EikonError: Error code 1422 | Can not process metadata for request: DataGrid_StandardAsync.requests.instruments - non-empty is required
(1) I manually create a subset of the "instruments" and run the get_data statement. And it works fine. But when I include the instrument with the 500 RICs, it reports errors.
(2) Some tickers do not return PE ratio, such as TNB.N^E12. Do you have any other alternative get PE ratio for this RIC?
Can you advise? Thank you.
Best Answer
-
Hi @ylian
1. The instruments variable contains empty value. So it causes the error.
2. Please contact the Refinitiv Content Helpdesk at https://my.refinitiv.com/ to get help on the field you are interested in.
Or you can use Data Item Browser to explore what field may fit with your requirement.
Data Item Browser tutorial is here.
0
Answers
-
Hi @chavalit.jintamalit Thank you for your response. That is a typo when I manually typed it in the thread.The quote in my original code is correct. Please advise me how to solve this issue. I try the same code on DJI index, it works. But when try to fetch the data from SPX, it reports error message.
The data item browser I used is from the formula builder in Eikon excel plugin. The TR.PE works for most of the RICs except some of them, I show you one of the RIC I found that have missing PE value, TNB.N^E12. Please advise me this is a glitch of your database or not.
Yili
0 -
Hi @ylian
For error in function call, it is because you pass in empty string.
Please try to code I show you so you understand that the instrument list contains an empty string.
For the TR.PE content clarification, please contact Refinitiv Content Helpdesk.
0 -
Hi @ylian
From technical point of view, I think you can use the 'Instrument' column instead of the 'RIC' column.
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 683 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 626 Refinitiv Data Platform Libraries
- 5 LSEG Due Diligence
- 1 LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 84 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛