Eikon Python API - get_timeseries() - bid/ask
Hello.
Do you plan to add bid and ask columns to the get_timeseries() function? According to the docs, bid and ask are not in list of available fields currently.
For example, for this RIC - /APCJ271702500.U - there no Close price, but there are Bid Close and Ask Close as of 2017-10-26, both can be retrieved using RHistory() in Excel. How to get them using get_timeseries()?
It seems that there is .WithView("BID") in C# API for this purpose, but is there any Python equivalent?
Thank you.
Best Answer
-
Hi,
Currently, timeseries service provides only a limited field list according to the selected interval:
- 'tick' => [TIMESTAMP, VALUE, VOLUME]
- 'daily', 'monthly', 'quarterly', 'yearly' => [TIMESTAMP, HIGH, CLOSE, LOW, OPEN, COUNT, VOLUME]
If you need other fields like ASK and BID, you should use get_data function:
>>> data, error=ek.get_data('MSFT.O', ['TR.ASKPRICE.Date', 'TR.ASKPRICE','TR.BIDPRICE'], parameters={'SDate':'2017-08-01', 'EDate':'2017-08-04'})
>>> data
Instrument Date Ask Price Bid Price
0 MSFT.O 2017-08-01T00:00:00Z 72.56 72.55
1 MSFT.O 2017-08-02T00:00:00Z 72.25 72.24
2 MSFT.O 2017-08-03T00:00:00Z 72.15 72.14
3 MSFT.O 2017-08-04T00:00:00Z 72.66 72.652
Answers
-
Does the get_timeseries function allow for adding Bid and Ask now? I am looking for a function that returns Bid and ask on a minutes level for a given stock.
0 -
Hi @basilio.konstantin.kalus ,
Please check the answer below from this thread
For your information, after this, please start the new post by asking a further question as the question with an accepted answer won't be monitored by the forum's moderator so the answer might not be provided.
I would recommend you look at the newer RD Library for Python - which is currently in Beta and due for release in the coming months.
The following code is able to get Bid and Ask in a minute interval
import refinitiv.data as rd
rd.open_session()
rd.get_history(universe="LSEG.L", fields=["BID", "ASK"], interval="1min")You may follow its example in the Codebook app on Eikon Desktop/ Refinitiv Workspace in the directory __Examples__/01. Data Retrieval & Discovery/01.01. Refinitiv Data Library/EX_01_01_02__Access__Get_History.ipynb
It will also have fuller documentation - the RD Library team advised that they are awaiting the completion of the documentation to confirm the release date.
Please let me know in case there is any further questions
0 -
Thanks for your response. However, I was not able to use the code snippet above.
import refinitiv.data as rd
always runs into an error (No module named 'refinitiv.data') and subsequently the code is not executing. I was not able to solve that issue. How can I avoid this error?
0 -
The refinitiv.data Python library needs to be installed before it can be imported.
It's recommended to follow this RD library quick start guide: getting started with Python.
Please let me know in case you have any questions.
0 -
I have used this command to install the library:
pip install refinitiv-dataplatform
import refinitiv.dataplatform as rdpHowever, it still does not work even if I open a desktop session and using my API key
rdp.open_desktop_session('MY API KEY')
The Dataframe I get is just empty, also if I run the code snippet provided on the refinitiv website like this one:
rdp.get_historical_price_summaries(
universe = 'VOD.L',
interval = rdp.Intervals.DAILY,
fields = ['BID','ASK','OPEN_PRC','HIGH_1','LOW_1','TRDPRC_1','NUM_MOVES','TRNOVR_UNS']
)0 -
Hi @basilio.konstantin.kalus ,
The refinitiv.data (RD) and Refinitiv.dataplatform (RDP) are the different libraries
as mentioned in this comment, The RD library is recommended to be used.
However, if you'd like to use refinitiv-dataplatform one, you could update your code to be as the below (import the library as rdp and do the rdp.open_desktop_session(), so it's matched with the rdp.get_historical_price_summaries()
)
Hope this helps
0 -
Hi @raksina.samasiri ,
thanks for your help. Unfortunately, this code only works in the codebook environment from Refinitiv (at least for me), it does not work if I run the code locally in Pycharm (while I am loged into Refintiv)
Do you have and recommendations to solve this issue?
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 中文论坛