Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /
avatar image
Question by eb_13 · Feb 15, 2020 at 06:35 PM · get_dataoptions#get_timeseriesspx

get_data function not returning timestamps/dates? (eikon data api / python)

Hi,


I'm trying to get historical options data but unable to get timestamps when I run the query below, I tried a few different fields instead of "CF_DATE" but none of them worked, 'Rh': 'date' parameter also doesn't seem to do anything. What is the right way to make this query?

e = dt.datetime(2020, 1, 17)
df_opt, err = ek.get_data('SPXm172029000.U', ['CF_DATE', 'TR.BIDPRICE', 'TR.ASKPRICE',
                                'TR.IMPLIEDVOLATILITYOFBIDPRICE', 'TR.IMPLIEDVOLATILITYOFASKPRICE'],
                          {'Rh': 'date', 'SDate': '{:%Y%m%d}'.format(e - dt.timedelta(days=365)),
                           'EDate': '{:%Y%m%d}'.format(e)})


I also tried get_timeseries query, but that doesn't like the ric and returns the error below.

df_opt, err = ek.get_timeseries(
    [ric], ['STRIKE_PRC', 'AQ_ASK', 'AQ_BID', 'BID', 'ASK', 'EXPIR_DATE', 'PUTCALLIND'],
    start_date=start_dt, end_date=end_dt)
Error with SPXm172029000.U: Invalid RIC
SPXm172029000.U: Invalid RIC | 
Traceback (most recent call last):
  File "C:\Users\Eren\source\.venv\meleti\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-44-cbda5db7f2c9>", line 3, in <module>
    start_date=start_dt, end_date=end_dt)
  File "C:\Users\Eren\source\.venv\meleti\lib\site-packages\eikon\time_series.py", line 197, in get_timeseries
    raise EikonError(-1, message=ts_error_messages)
eikon.eikonError.EikonError: Error code -1 | SPXm172029000.U: Invalid RIC | 


Thanks,

E

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by chavalit.jintamalit · Feb 17, 2020 at 02:27 AM

Hi @eb_13

I tried to retrieve all option from this sample code:

df,e = ek.get_data(['0#SPX*.U'],['PUTCALLIND','STRIKE_PRC','EXPIR_DATE','CF_CLOSE','IMP_VOLT']) df.head(5)

Here is the result:


So I selected SPXb212010000.U as a sample.


ahs1.png (128.9 KiB)
ahs2.png (50.5 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by chavalit.jintamalit · Feb 16, 2020 at 01:51 AM

Hi @eb_13

SPXm172029000.U is not a valid RIC code.


I tried retrieving data for IBM.N


ahs1.png (41.0 KiB)
ahs2.png (36.2 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by eb_13 · Feb 16, 2020 at 02:03 PM

Hi @chavalit.jintamalit, thanks for your response!

I believe It is...


I tried many different contracts, same issue, field cannot be found, here's with a different one.Here's another one, I think it's a different field for options, but don't know which one.

end_dt = e if e < today else today
# ric is 'SPXm172033000.U' in this case
df_opt, err = ek.get_data(ric, ['CF_DATE', 'TR.BIDPRICE', 'TR.ASKPRICE',
                                'TR.IMPLIEDVOLATILITYOFBIDPRICE', 'TR.IMPLIEDVOLATILITYOFASKPRICE'],
                          {'Rh': 'date', 'SDate': '{:%Y%m%d}'.format(end_dt - dt.timedelta(days=365)),
                           'EDate': '{:%Y%m%d}'.format(end_dt)})



1581860336984.png (23.3 KiB)
1581860724094.png (18.3 KiB)
Comment

People who like this

0 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
marcin.bunkowski · Feb 17, 2020 at 09:44 AM 0
Share

Hi @eb_13

Code <SPXm172029000.U> is for an expired 2020 Jan option that is no longer on a feed. When you are typing that at your end it gives you the info from your local search history cache as you were probably using this code when it was live and active.

Compare that with the RIC that is active now:

@chavalit.jintamalit FYI

ahs.jpg (18.3 KiB)
ahs2.jpg (25.9 KiB)
avatar image
Answer by eb_13 · Feb 18, 2020 at 12:59 AM

It's an expired option so it won't be part of the current option chain you got there, but regardless, you answered my question, I did not know that you could do "[field name],DATE" to get the timestamp. Thanks!

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
9 People are following this question.

Related Questions

Trying to retrieve S&P500 Index options,

Using Python API, how to distinguish between option expiry periodicity (Weekly, Monthly, Quarterly)?

get_data for all RIC based on an option roots

How are the datapoints limits calculated

get_data returning only 1 row even after adding start date and end date

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges