SALTIM field returns the time of the last trade today but it returns 19:23:34 when its 2pm. What tim
Best Answer
-
Hello @vlad.dimanshteyn ,
The response should be in UTC.
Please see this previous discussion thread for more information on EDAPI usage, and this external discussion for more on converting to the required time zone.
Hope this information helps
2
Answers
-
Thanks so much Zoya, spasibo. I would convert this to Eastern I guess to get the time of the last SPX Option trade. How would I get the price of an underlying (SPX) at that time? Thanks so much !!!!0
-
Hello @vlad.dimanshteyn ,
If I understand the requirement correctly, would it be easier to get all ticks and therefore the last price tick, per day?
ek.get_timeseries('SPXWe202240200.U', start_date = '2022-05-12', end_date = '2022-05-13',interval='tick')
result:
however, is this what you are looking for or something different?
1 -
This is great Zoya. May be very time consuming. Tell me what you think. I'm trying to get the last trading price/time for all options in SPX option chain. In addition, at the time of those trades I need the price for underlying (SPX) so I can calculate volatility surface. So I'm getting option chain using:
option_chain, err = ek.get_data('0#SPXW*.U', ['TRADE_DATE', 'ACVOL_1'])
then getting rid of some options based on volume and get the last trading price using:
option_data_block, err =ek.get_data(instruments=option_chain['Instrument'].tolist()[lower_limit:upper_limit], fields=['PUTCALLIND', 'TRDPRC_1', 'CF_BID', 'CF_ASK', 'TRADE_DATE', 'SALTIM', 'STRIKE_PRC', 'EXPIR_DATE'])
I was going to convert SALTIM time to Eastern ....
But I still need to get the price of underlying (SXP Index) at the time of those trades. I was hoping to get that using converted time of those last option trades in the chain. Can this makes sense and you have a good sulution.
Thanks so much Zoya !!!!
Vlad
0 -
Hello @vlad.dimanshteyn,
It may be worthwhile to take a look at RD Library and quantitative analytics that are part of it, and IPA volatility surface examples that are part CodeBook example deck:
Eikon/Workspace-> CodeBook
_Examples_->Quantitative Analytics-> Surfaces
If this is something that you are able to reuse, you will undoubtedly need modifications, but should still be significantly less time and effort that building fully on your own with just eikon prices, so may be worth reviewing?
1 -
Thanks Zoya. I'll take a look at your surfaces. I developed the code to create surfaces already, so that is not an issue. I just need to get the SPX Index price at a time of the last Option trade for all SPX options. How would I do that? I'm getting all the other data already. Thanks so much.0
-
If I could just get the data, I should be in great shape. I will check out your vol surface code but I developed code to do pretty complex vol surface. All I need is the data I'm getting already + SPX Index price at the time of the last option trade. Thank so much for your help.
0 -
Hello @vlad.dimanshteyn ,
I think you are very much on top of what needs to be done.
I'd like to discuss what I think could be the approach to use.
I notice from running your code that not all the requested instruments have TRADE_DATE and SALTIM populated. From what is populated you can select the latest available.
I do not believe you have to convert it. It can be used that to define the request interval. As you can not request price at exact specific point of time, but you can request full price ticks as bordered by timestamp, you can use the returned timestamp as end_date and define start_date as a couple of minutes before end_date.
For example, I am looking at the following line in option_data_block result, let us assume that this is the latest SALTIM = 14:40:52:
You could go:
ek.get_timeseries('.SPX',start_date='2022-05-12T14:40:50', end_date='2022-05-12T14:40:52', interval='tick')
And receive:
The latest value that falls within the interval defined should be what you are looking for.
The interval may have to be further tuned up, to ensure that at least one update of .SPX falls within the interval and you are able to use the last data point returned in the interval.
I would lastly like to mention, that RD libraries and RD quantitative analytics examples use RDP IPA analytics that are quite sophisticated, and where I can not be sure is, if this strategy will be equally precise and account for all requirements, or if there is more to the calculations that are part of RDP IPA. I will, just in case, include IPA Volatility Surfaces - Getting Started dev guide link, and right after it you will find the more detailed guides to the three types of surfaces that are calculated by IPA, so you could perhaps judge for yourself, if this is something that could be of value to your organization.
1 -
Thanks so much Zoya, you are a great help and really smart. The reason some TRADE_DATES & SALTIM not populated is because I did not send you one line code that goes between two lined I've sent you. That line filters out everything where the date is not today and Volume < some number. If those are filtered out, you do not get <NA>s for TRADE_DATE & SALTIM. You want to pick most liquid options (Volume > 250 or so) to construct the surface. Let me think about your solution, I think it's great & I will most likely implement it. I will also look at all you references and let you know. Thanks so much for your help. Have a great weekend, Vlad0
-
Just took a look at the link you sent, pretty cool stuff. I'll have to look deeper to see what algorithms you guys use because we do use exotic options (Asians, Cliquets, etc) but it seems you have a lot of good things there that I may be able to use. I also had a quick question that you may know the answer to. When I installed your package with PIP yesterday, there were some conflicts with Spyder (Anaconda default) Now when I run any script, there are all these exceptions in the Console window. Is there a place where can find out compatibilities and how to fix this issue. Thanks so much again Zoya. Vlad
0 -
Hello @vlad.dimanshteyn ,
On compatibilities, there is usually more then one compatible set, but for the latest library's installed modules would see:
Eikon/Workspace-> Codebook
file:
__Libraries&Extensions.md
To troubleshoot the specific issue you are facing, you can ether search these forums for your error message- you are likely to find many posts with helpful answers or review the helpful article Eikon Data API(Python) Troubleshooting | Refinitiv.
Please try asking a new question as a separate new question, rather then a comment, as this allows for each question to have one "best" answer" that very easy to find for the next users with the same or similar question, contributing toward the usefulness and helpfulness of these developers forums. Thanks
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛