Retrieval of Snapshot data with RDP for Python
Hi,
Two years ago we started with Python for RDP and developed an interface to import prices. At that time Umar Nalla had adviced us to use streaming interface with the Snapshot option.
Now - from a contractual point we want to move fully to snapshot data. Brokers are requesting real time licensing unless we can show that technically we only read (slightly delayed) snapshot data. Can you show us how to move from the current solution - where we load streaming data, and then snapshot this - to a real snapshot API?
Additionally we want to be able to query historical data. Same as in Eikon with the Rhistory function we want to be able to retrieve historic close data points. Can you help us setup a API for this?
Best Answer
-
Hi @VFM ,
Looking through the Developer Portal, I found the article 'Migrating COM API calls to Python'; while it does not answer your question directly, it has a lot of information you may be after. Namely:rd.get_data:
realTimeImage = rd.get_data(
universe=['GBP=', 'EUR=', 'JPY='],
fields=['BID', 'ASK'])rd.open_pricing_stream:
def display_data(data, instrument, stream):
clear_output(wait=True)
current_time = datetime.datetime.now().time()
print(current_time, "- Data received for", instrument)
display(data)
stream = rd.open_pricing_stream(
universe=['GBP=', 'EUR=', 'JPY='],
fields=['BID', 'ASK'],
on_data=display_data
)
stream.open()stream.close()
and rd.get_history:
FTSEConstituentDf1 = rd.get_data(
universe=['0#.FTSE'],
fields=['TR.TURNOVER.timestamp', 'TR.TURNOVER', 'TR.EVToSales'])
FTSEConstituents = list(FTSEConstituentDf1['Instrument'])
IntradayTimeSeriesDf2 = rd.get_history(
universe=FTSEConstituents,
fields=['TRDPRC_1'],
interval="10min", # The consolidation interval. Supported intervals are: tick, tas, taq, minute, 1min, 5min, 10min, 30min, 60min, hourly, 1h, daily, 1d, 1D, 7D, 7d, weekly, 1W, monthly, 1M, quarterly, 3M, 6M, yearly, 1Y.
start="2022-06-01T13:00:00",
end="2022-06-01T16:00:00")
IntradayTimeSeriesDf2Are those the calls you were after?
0
Answers
-
Hi Jonathan,
Can you explain to me what is the difference between the refinitiv.data and refinitiv.dataplatform API? We used the Refinitiv Data Plaform API version 1.0.0a10 till now. The problem is that we want to transfer away from real time pricing to snapshots. (And want an option to retrieve historical rates).
So currently I have this:
pricing = rdp.StreamingPrices(session=session,
universe=df_rics['RIC'].dropna().tolist(),
fields=df_fids['FID'].dropna().tolist()
)
pricing.open()
pricing.get_snapshot()
pricing.close()
This is not what we want - as we are basicly still using streaming prices.
0 -
Hi,
After consultation with the team, we understand that we need to use Refinitiv Data library. Trying to install the refinitiv data library we do encounter some problems:
So coming from refinitiv-dataplatform==1.0.0a10
First we installed Refintiv Data version 1.3.1
First we had an error: no module named simplejson.
We installed simplejson seperate.
Then we found that httpx delivered with the wheel for Refinitiv Data is version 0.19 while Refintiv Data required a higher version.
We installed httpx-0.24 manually
Next we got the error "module 'httpcore' has no attribute 'ConnectionPool'
We installed httpcore 0.17.3 manually
Now again we run into problems:
import refinitiv.data as rd
> Exception has occured: module 'h11' has no attribute 'Event'
Can you please check and let us know the correct way to install Refinitiv Data Library for Python under windows?
0 -
Hi @VFM ,
Have you had a chance to look into the RD Library for Python - Quick start guide that shows installation steps
0 -
Hello @VFM
Are you using Python or Anaconda/Miniconda distribution?
I suggest you create a new Python environment, and try "pip install refinitiv-data" in that environment again.
If you are using Python:
- https://realpython.com/python-virtual-environments-a-primer/
- https://www.freecodecamp.org/news/how-to-setup-virtual-environments-in-python/
If you are using Anaconda/Miniconda"
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
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛