Historical data : MarketCap of all listed companies in Japan.
I'm struggling with combining ① wiht ②. I'd greatly appreciate any suggestions you might have.
① I can get all listed companies in Japan with the below.
universe='SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/),IN(TR.ExchangeCountryCode,"JP"), IN(TR.InstrumentTypeCode,"ORD"), CURN=JPY)'
data, err = ek.get_data(instruments=universe, fields=['TR.CommonName'])
data.head()
② I can get the historical data of some companies' MarketCap like this.
data= ek.get_data(['2195.T','3639.T','3640.T','3641.T'], ['TR.CompanyMarketCap'],
{'SDate': '2019-8-31', 'EDate':'2015-9-30', 'Period':'FQ0','FRQ': 'M','Scale': 6})
print(data)
by @tnksnsk314
Best Answer
-
I would suggest you to split the call into 2 calls.
1. Get RIC list first
universe='SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/),IN(TR.ExchangeCountryCode,"JP"), IN(TR.InstrumentTypeCode,"ORD"), CURN=JPY)'
df,e = ek.get_data(universe, ['TR.RIC'])
ric_list = df['Instrument'].tolist()
#split the list into a smaller list (to avoid hitting limit)
ric_list1 = ric_list[0:1000]
ric_list2 = ric_list[1000:2000]
ric_list3 = ric_list[2000:3000]
ric_list4 = ric_list[3000:]2. Get MarketCap and MarketCap date from the RIC list
data1, err = ek.get_data(ric_list1,['TR.CompanyMarketCap.Date','TR.CompanyMarketCap'],
{'SDate': '2015-9-30', 'EDate':'2019-8-31', 'Period':'FQ0','FRQ': 'M','Scale': 6})
data1.head()Here is sample output:
I was able to get the data back from the whole list at once, but this is not suggested.
1
Answers
-
Hi @Shinsuke.Tanaka,
You didn't provide the details of what happens when you combine ① with ②. I'll assume you received output such as this (Note: I also echoed the err value to the screen):
I have not seen this error before but my suspicions are that you have exceeded a data limit. The data range you specified includes 48 different periods between each instrument. Limiting your date range will actually return a valid result.
For example:
1 -
I appreciate your suggetion. I'd like to have the result along with date like 2019/8/31, 2019/7/31. Which field should I put in the program?
0 -
You can apply the TR.CompanyMarketCap.Date field to your fields list. Refer to the DIB (Data Item Browser) within Eikon for a list of available fields/parameters.
Note: Because a new field is added, this will further reduce the date range as the new field contributes to the size of the data set. I would suggest you break down your universe if you want a specific date range as part of your result.
1 -
@Nick.Sincone.1
Thank you! I didn't notice the field in DIB. regards, Shinsuke
0 -
I understood. I will do it and show my client. Thank you! regards, Shinsuke
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 162 App Studio
- 4 Block Chain
- 5 Bot Platform
- 17 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 370 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛