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.
Best Answer
-
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.22You 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
0
Answers
-
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.
0 -
@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.
0 -
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.0 -
The developer may also find the following post useful
0 -
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.
0 -
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.
0 -
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.
0 -
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'})
0 -
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
0 -
Please share the RIC list so we can try and recreate. Thanks.
0 -
It's these two:
JNI1MO=RJNI24MO=R0 -
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.
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
- 616 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
- 557 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
- 653 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
- 229 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 中文论坛