How would you get ohlc data for regular trading hours in the python Eikon Data Api?
When I pull some OHLC data through the python API, through either get_data() or get_timeseries() I get the bar for the entire day. Can I restrict it to regular trading hours, and how would I do that?
Best Answer
-
Trade summarization into OHLC is performed in accordance with exchange or market regulation or practice. For US stocks for example pre and post market trades are excluded from daily OHLC summarization. For some other markets there may be different RICs for different sessions, e.g. for cash settled corn futures on Brazilian B3 exchange "0#CCM:" chain provides consolidated quotes, "0#1CCM" chain provides after hours quotes and chain "0#2CCM:" provides regular session quotes.
If you would like an explanation how trades are summarized into daily OHLC for a specific market you're following, or if you'd like to know whether there are RICs that differentiate between trading sessions for this market, the best resource is Refinitiv Helpdesk, which you can reach using Contact Us capability in your Eikon application or by visiting MyRefinitiv. The moderators on this forum do not have deep expertise in every type of content available through Refinitiv products, however such expertise is available through the Helpdesk.
0
Answers
-
The get_timeseries call be used to restrict the time range like this:
>>> df = ek.get_timeseries("IBM.N", start_date = "2020-12-01T15:04:05", end_date = "2020-12-05T15:04:05", interval="minute")
>>> df
IBM.N HIGH LOW OPEN CLOSE COUNT VOLUME
Date
2020-12-01 15:05:00 125.11 125.05 125.09 125.07 18 2014
2020-12-01 15:06:00 125.10 125.03 125.03 125.04 35 3958
2020-12-01 15:07:00 125.11 124.99 125.05 125.11 36 3045
2020-12-01 15:08:00 125.30 125.14 125.14 125.22 56 6730
2020-12-01 15:09:00 125.29 125.14 125.24 125.14 31 2075
... ... ... ... ... ... ...
2020-12-04 20:57:00 127.10 127.07 127.07 127.07 104 10998
2020-12-04 20:58:00 127.10 127.06 127.06 127.08 80 11037
2020-12-04 20:59:00 127.13 127.06 127.07 127.13 88 14943
2020-12-04 21:00:00 127.22 127.12 127.14 127.17 238 31626
2020-12-04 21:01:00 127.20 127.20 127.20 127.20 1 388463
[1529 rows x 6 columns]The time is in the UTC - '%Y-%m-%dT%H:%M:%S' format.
0
Categories
- All Categories
- 6 AHS
- 37 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
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛