For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 0

How can I get historical data for SPX3MO=R using the Python API?

I'm trying to retrieve the historical data for SPX3MO=R using the Python API. CF_CLOSE, CF_LAST fields as available, but they only give me the current data. However, when I open the daily charts I see the historical data is available. Can you please advise?


Sample formula used: ek.get_data("SPX3MO=R", "HST_CLOSE", {'SDate':'2020-04-30'})


I would like to see historical data at the longer date. Looking forward for your help.

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

Upvote
Accepted
20.3k 73 10 20

Hi @Paco Sebastian.Sunico

The following provides me with historical data

ric = 'SPX3MO=R'
startdate = '2015-01-01T00:00:00'
enddate = '2020-05-12T00:00:00'
interval = 'daily'
 
df = ek.get_timeseries(
        [ric],
        start_date=startdate,
        end_date=enddate,
        interval=interval )
print(df)

outputs:

SPX3MO=R    
VALUE Date             
2015-01-02  15.37 
2015-01-05  16.74 
2015-01-06  17.53 
2015-01-07  16.45 
2015-01-08  14.97 
...           ... 
2020-05-06  29.86 
2020-05-07  28.00 
2020-05-08  25.70 
2020-05-11  24.70 
2020-05-12  28.22

You can find more details on the get_timeseries method here

Note that not all the time intervals + fields listed in the documentation are available for all RICs.

If you do want to discuss what data is available you can create a Content ticket via MyRefinitiv


icon clock
10 |1500

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

@Umer Nalla Per the user, he uses get_data formula. He needs the name of the field that can be used, please. Can you please advise? Looking forward for your response.

Hi @Romerson.Gadil

I have been advised that you cannot get timeseries of price history for this RIC using get_data.
The get_data method provides equivalent capabilities to =TR function in Eikon Excel.
If the Eikon Helpdesk can find a way to retrieve the required data using =TR function, then the same fields and parameters can be used in get_data. But if the Eikon Helpdesk cannot find a way to use =TR to retrieve the historical data for this RIC, then get_data cannot be used for this purpose either.


Hi Umer,


The user has a followup.


"I'm essentially trying to get implied volatilities ATM data for equity indices. Can you please advise what's the best way to do it? SPX3MO=R looked like a good candidate RIC for SPX, but perhaps there are other better ones. "


I tried checking the link you have provided however I am afraid I may not be able to translate the right answers. https://community.developers.refinitiv.com/questions/45848/how-can-i-pull-historical-implied-vol-surfaces-to.html


Looking forward for your usual help. Thank you in advance.

Hi @Romerson.Gadil

This is really a question for the Content team - as I explained during our chat, this forum is aimed to answer "how to" types of questions about using Refinitiv APIs - we advise those which questions such as 'how do I get such data' or 'which RIC is the correct one for this data' to raise a content ticket.

Hi,

Thanks for help so far, very useful.

I've changed the code to use get_timeseries, but now some data comes with "CLOSE" label instead of the relevant identifier. Any idea how to fix this, please?

Thanks,

Jakub

1591957539583.png (36.0 KiB)
Show more comments

As SPX3MO=R is a Volatility Surface, the client may be interested in our Instrument Pricing Analytics data - which is available on the Refinitiv Data Platform and includes Volatility Surface data.

Here is an article on the Vol Surfaces offering Instrument Pricing Analytics - Volatility Surfaces and Curves

IF they are interested, they should reach out to their Refinitiv Account Team to discuss further.

Hi @Romerson.Gadil

You can consider using an alternative RIC code SPXATMIV.U that gives you the market expectation of 30,60 and 90 day forward-looking volatility.

ek.get_data('SPXATMIV.U','TR.90DAYATTHEMONEYIMPLIEDVOLATILITYINDEXFORPUTOPTIONS.date','TR.90DAYATTHEMONEYIMPLIEDVOLATILITYINDEXFORPUTOPTIONS','TR.90DAYATTHEMONEYIMPLIEDVOLATILITYINDEXFORCALLOPTIONS'],{"Sdate":'0D', "Edate":'-10D'})

ahs.jpg (77.1 KiB)
Upvotes
1 0 0 1

This query was raised by an external user Jakub Januszewski from UBS AG London Branch. Please treat this query as urgent as the client is working to retrieve the historical data. We look forward for your response.

icon clock
10 |1500

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

Upvotes
20.3k 73 10 20

Hi @jakub.januszewski

Those two - RICS JNI1MO=R, JNI24MO=R - return the value in a 'CLOSE' field, whereas the others return the value in a 'VALUE' field.

I am not a content expert, so cannot explain why the fields returned are different.

One workaround would be to request the two sets of RICs separately - otherwise, pleaseask the Content Helpdesk why they field names differ.


icon clock
10 |1500

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

Click below to post an Idea Post Idea