Eikon API access to historical volume and other financial data

I'm looking to get Volatility and Volume information form the Eikon python API, both real time and historical. I'm having some issues, so first I'll explain what I can do, and then ask the questions:
I've been able to get real-time access to volume and volatility information using the ek.get_data function, and using the following variables:
"TR.Volatility10D", "TR.VOLUME", "CF_VOLUME",
But not with "VOLUME" which does not return data.
When looking for the same information from the past using ek.get_timeseries, I couldn't not find any data using "TR.Volatility10D", "TR.VOLUME" or "CF_VOLUME",
But mysteriously "VOLUME" works to return historical data.
Below is one query I was testing:
prices = ek.get_timeseries(['DIA.N', 'SPY.N'], fields=["TR.Volatility10D", "VOLUME", "TR.VOLUME", "Close"], start_date = "2019-01-18", end_date = "2019-01-25",
interval="hour")
Now my questions:
- Variable names that work with get_timeseries are different than those that work with get_data - where is this inconsistency documented?
- How can I get historical Volatility information using ek.get_timeseries?
Thanks for the help!
-- Jonathan
Best Answer
-
@jlansey it is a very good question, but first let me give you a bit of a background of the various data models in the context of getting real-time data and time series.
You have used 4 different fields:
- TR.Volatility10D
- TR.VOLUME
- CF_VOLUME
- VOLUME
There are three different systems that you get access to with ek.get_data() and ek.get_timeseries(). It is the real-time, reference and time series databases. All of them use RIC (where available) as a primary identifier, however, use different fields. Let me explain the difference
Real-time vs reference data
Real-time fields is what you see in the Quote app (<F4> in Eikon). You can hover over a specific value and it will give you the field name. For instance, Apple's shares:
Real-time fields will be capitalized and, sometimes, have a CF_ prefix (for common field).
Reference data fields will have a 'TR.' prefix, so if you see it in the field name, it means it is coming from the reference database. TR.Volatility10D represents a value in the reference database. TR.Volume represents a series in the in the reference database.
Both real-time and reference databases can be queried by ```ek.get_data()```
Real-time vs time series
Time series database is structured a little bit differently. For each instrument we collect a number of intervals (inter-day or intraday), each interval has a set of views, which is a set of fields. With the python api you currently have access to only the default view (either the trade price (TRDPRC_1) for exchange traded instruments or last quote (CF_LAST) for contributed instruments).
In your case, VOLUME is a field of a standard view, and for my example it is equivalent of a time series request to TRDPRC_1.VOLUME data.
Time series database is accessed with ```ek.get_timeseries()```
Summary
So, the correct way to structure the request is the following:
```ek.get_data(['DIA.N', 'SPY.N'], ['TR.Volatility10D','CF_VOLUME'])``` for the real-time volume and 10D volatility (not including today).
```ek.get_timeseries(['DIA.N', 'SPY.N'], ['VOLUME'])``` for the time series.
0
Answers
-
Wow this is a great answer!!! Thank you so much. Some follow up clarifications if you don't mind:
"TRDPRC_1.VOLUME" is not the days trading volume, but only the volume of the very last trade that happened at the stated time, which is why it is bouncing all around instead of growing steadily by day. And there is no way to get a comprehensive list of all the trades as a point process/series.
- There is no way to get a cumulative or average trading volume for historical data
- There is no way to get historical volatility data of any sort - with only real time volatility information available.
Please let me know if my understanding here now is correct about this, thanks!
-- Jonathan
0 -
TRDPRC_1.VOLUME, as well as CF_VOLUME and TR.Volume in fact represent the accumulated volume information for the day.
The easiest way to get average volume is to pass a ```AVG``` function to the get_data request, for instance, this will give you the average volume for the last 10 days:
ek.get_data('AAPL.O', ['AVG(TR.Volume)'], {'SDate':'0D', 'EDate': '-9D'})
I have not found a way to get volatility data as series, but I encourage you to contact your local Refinitiv support desk, since this is a content question. They will help you model what you want in Excel, which is then portable into python.
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
- 682 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
- 83 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛