For a deeper look into our Eikon Data API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials | Articles
You can use the following statement to get your constituents:
option_chain,err = ek.get_data('0#SPX*.U', ['CF_NAME'])
And to get your real-time data, try something like this: (Note: The Pricing interface / WebSocket service has a limitation when making a single request - so you will have to break up the request into buckets - in the example below, I'm using a value of 100).
Nick,
I need Web Socket Service for this as I understand, is that correct? That's a separate subscription that I need to get, right? I do no have Refinitiv library to do
from refinitiv.data.content import pricing
I just have Eikon library
Thanks so much for your help
The refinitiv.data library should be available to you. You can refer to the learning material on our dev portal for more details: Refinitiv Data Library for Python. I believe you should have streaming services as part of your license - I would try one of the basic tutorials within the link I provided.
Thank you sir for those last 2 messages. I really appreciate it. As long as I can do from refinitiv.data.content import pricing
I should be fine. May have to install that package. I'll try it tomorrow and let you know. We have your data company wide, we dropped Bloomberg so I would think I have license needed.
Hi Nick,
1 last question. I also need to get weekly SPX option chain. Its about 13,000 items. When I run:
option_chain, err = ek.get_data('0#SPXW*.U', ['CF_NAME'])
it times out. What options do I have to get weekly SPX option chain? Can I use a filter to pull only a subset of them?
Thanks so much Nick
Does the request to retrieve this option chain always fail? I don't know if it may fall into the category of data limits or if there is a backend issue. I think it would be best if you were to post this as a separate question as I think it will involve more than a few comments here :-). Thanks.
If you want to get real-time data, I would suggest you look at the pricing cache example which subscribes to data and allows the ability to pull out live data from the cache.
Currently I use:
option_chain, err = ek.get_data('0#SPX*.U', ['TRADE_DATE', 'ACVOL_1'])
option_data_block, err = ek.get_data(instruments =option_chain['Instrument'].tolist(), fields=['PUTCALLIND', 'TRDPRC_1', 'BID', 'ASK', 'TRADE_DATE', 'SALTIM', 'STRIKE_PRC', 'EXPIR_DATE'])
undelying_price, err = ek.get_data('.SPX', ['CF_LAST'])
Are you saying Nick that I can not use those 3 statements to get real time option data and the price of underlying?