problems with StreamingPrices object's "open()" method

Hi,
I was trying to use eikon's streaming prices function via Python API.
I simply copy and paste github's tutorial code as following on my jupyter and spyder:
streaming_prices = ek.StreamingPrices(
instruments = ['GBP=','JPY=', 'CAD='],
fields = ['CF_BID','CF_ASK','OPEN_PRC', 'CF_HIGH','CF_LOW', 'CF_CLOSE'] )
streaming_prices.open()
but both IDE can't finish running "open()" function.
Does anyone have the same problem?
My conda version is 4.4.10 and eikon API version is 1.1.2.
Best Answer
-
I just tested the code and it works fine for me:
So I checked a little bit on your profile but I could not find Thomson Reuters Eikon product associated with your profile.
Anyway, I can confirm that the API call is valid.
Are you able to retrieve snapshot data using get_data() ?
df,e = ek.get_data(['GBP=','JPY=','CAD='],
['CF_BID','CF_ASK','OPEN_PRC','CF_HIGH','CF_LOW','CF_CLOSE'])
df0
Answers
-
Hello @lawrence.chiang
In addition to the info from @chavalit-jintamalit
1. I would confirm you are on the new version of Eikon library,by upgrading to the latest:
python -m pip install --upgrade eikon
2. Make sure your Eikon desktop is running and you are logged in and no errors are reported by Eikon desktop.
3. Next, would also, right after you include eikon, at the very beginning of tutorial code, confirm that your Jupiter, and environment are in a good state by doing
import eikon as ek
import datetime
print(ek.__version__)You should see your library version printed.
If you do not, it is environment and not this specific code, would close any browsers, restart Jupiter, make sure you are in a clean state and then re-run.
0 -
Thank you
I can run your code and output is as follow:
Instrument CF_BID CF_ASK OPEN_PRC CF_HIGH CF_LOW CF_CLOSE
0 GBP= 1.2788 1.2792 1.2810 1.2830 1.2781 1.2810
1 JPY= 107.3900 107.4200 107.1200 107.6800 106.8600 107.1200
2 CAD= 1.3356 1.3357 1.3382 1.3387 1.3344 1.3385
so i think my eikon api runs fine except for streaming prices function?
or is it because i shouldn't use jupyter to run streaming price function?
thanks for your help!
0 -
Thank you!
I already update my eikon library to 1.1.2
the out put of print(ek.__version__) is 1.1.2
0 -
Hello @lawrence.chiang,
Streaming prices example runs in jupiter notebook.
Please note, it does not immediately return with result on Open, it takes a pause before I see the output.
In jupiter, something else may be already running, and preventing. May be worthwhile to restart the kernel on the page, and to re-run beginning from the first step of the example: connection, api key, session, then open.
Hope this helps.
0 -
The code works on Jupyter notebook.
But please do as @zoya faberov suggested.
Restart the notebook before running the code
def display_fields(streaming_prices, instrument_name, fields):
print("Fields received for", instrument_name, ":", fields)
streaming_prices = ek.StreamingPrices(
instruments = ['EUR=','GBP=','JPY=', 'CAD='],
fields = ['SALTIM', 'CF_BID','CF_ASK','OPEN_PRC', 'CF_HIGH','CF_LOW', 'CF_CLOSE'],
on_refresh = lambda streaming_prices, instrument_name, fields :
display_fields(streaming_prices, instrument_name, fields),
on_update = lambda streaming_prices, instrument_name, fields :
display_fields(streaming_prices, instrument_name, fields)
)
streaming_prices.open()0 -
Hello team,
I 'm having the same issue and done all the checks,
This method seems just not running.
I had it complete once (returning open:3) but got only Nans in values,
Can someone help?
Thanks,
Mahjoub
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 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
- 252 ETA
- 556 WebSocket API
- 38 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
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- 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
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛