How to get the values for Turnover for a specific FY and CY using Eikon API?
Hi,
I'm trying to get the values of Turnover for a list of industries for a specific calendar year and fiscal year. However, I obtained the values which are absolutely identical for CY and FY.
Is it the right way I used to get the values or something is missing?
x <- get_data(instruments,list("TR.TURNOVER(Frq = FY, SDate = FY2008, EDate = FY2008, Curn=USD)")); #for FY2008
x <- get_data(instruments,list("TR.TURNOVER(Frq = CY, SDate = '2008-01-01', EDate = '2008-12-31', Curn=USD)"));
Best Answer
-
TR.TURNOVER field provides timeseries of daily turnover for the stock. Setting Frq parameter to an annual value does not result in aggregating daily turnover into annual turnover, it will just return the daily turnover for the last day of the year, which I'm guessing is not what you're looking for. To return aggregated turnover for a year use aggregation functions, e.g. for total turnover between two dates use
get_data(instruments,"SUM(TR.TURNOVER(SDate=20190101,EDate=20191231))")
Timeseries of price history do not respect parameters representing fiscal periods. To get total turnover for a fiscal year use start and end date of the fiscal year. To find out fiscal year end date for a company use TR.ISPeriodEndDate field.
0
Answers
-
Hi @Iana,
The 2nd parameter in the get_data() function call can be either a single field or an array of fields. When you apply the list() function with a string, it will create an array of individual characters which isn't what you want. In your case, you are only specifying 1 field,
So try something like this:
x <- get_data(instruments,"TR.TURNOVER(Frq = FY, SDate = FY2008, EDate = FY2008, Curn=USD)"); #for FY2008
or this
x <- get_data(instruments,["TR.TURNOVER(Frq = FY, SDate = FY2008, EDate = FY2008, Curn=USD)"]); #for FY2008
0 -
Thanks for your comment. I tried the following code:
get_data(instruments,"SUM(TR.TURNOVER(SDate=20190101,EDate=20191231))")
However, it did not return any values "No data available in table".
BUT this worked!
get_data(instruments,list("TR.TURNOVER(CALCMETHOD=SUM, SDate=20080101,EDate=20081231,Frq=CY, Curn=USD)"));
0 -
Hi @Iana,
Can you please confirm what specifically works? When you apply the list() function to a string, as you did in the code segment that works for you, it will tokenize the string into individual characters and as a result, throw an error. For example:
Can you produce a screenshot of the request and output?
Also, can you confirm what failed with this command:
get_data(instruments,"SUM(TR.TURNOVER(SDate=20190101,EDate=20191231))")
For example, if I try the above syntax, this is what is returned (for my instrument):
In the first part of this, I decided to do a small test with a short period to show the breakdown of TURNOVER values and the sum() to show the total. I then use the SUM() within the field to demonstrate the value is the same.
0 -
Judging by the syntax of the code snippets in the original post, @Iana is using R. In R the "list" function with a single string argument returns a list with a single element that is the input string.
I do second the second part of your question. It would be interesting to find out why the syntax I provided didn't work for @Iana. My guess is that the request timed out. Eikonapir library has not been updated to use asynchronous Datagrid endpoint. In any case the method that did work for @Iana is actually better than the one I suggested.0 -
Hi @nick.zincone.1! I used R instead of Python. Overall, I tried these two ways for 2008 CY.
The first one:
TurnoverTexAp081<- get_data(instruments,list("SUM(TR.TURNOVER(SDate=20080101, EDate=20081231, Frq=CY, Curn=USD))"))
It gives the following results:
The second way:
TurnoverTexAp082 <- get_data(instruments,list("TR.TURNOVER(CALCMETHOD=SUM, SDate=20080101, EDate=20081231, Frq=CY, Curn=USD)"));
The output is as follows:
It's a bit strange that the results are that much different, despite the fact that the sum is used in both options.
0 -
If you're using SUM aggregation function, then as an argument for this function you need to provide daily turnover timeseries. Since you include Frq=CY parameter, instead of timeseries of daily turnover you're passing to the SUM function a single value representing the daily turnover on the last day of the calendar year. For most of the stocks in your list this value does not exist, as these stocks are not very liquid and most of them did not trade on 31-Dec-2008. For stocks that did trade on 31-Dec-2008 the value returned is the turnover for the day of 31-Dec-2008, not for the whole year of 2008. This explains why you got no values for most of the stocks when you used the SUM function, and where you did get a value, the value did not match the value you got when using CALCMETHOD=SUM parameter. If you drop Frq=CY parameter from your request using SUM aggregation function, then the values you retrieve will match those returned when you use CALCMETHOD=SUM parameter.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 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
- 367 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 中文论坛