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 /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by vlad.dimanshteyn · May 12 at 09:13 PM · helpdesk

SALTIM field returns the time of the last trade today but it returns 19:23:34 when its 2pm. What timezone is and how to convert it in Easter timezone? Thanks

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.

5 Replies

  • Sort: 
avatar image
REFINITIV
Answer by zoya faberov · May 12 at 09:46 PM

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


Comment
vlad.dimanshteyn

People who like this

1 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
vlad.dimanshteyn · May 13 at 01:51 PM 0
Share
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 !!!!
avatar image
REFINITIV
Answer by zoya faberov · May 13 at 04:07 PM

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:

ticks.gif

however, is this what you are looking for or something different?


ticks.gif (64.4 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
vlad.dimanshteyn · May 13 at 05:05 PM 0
Share

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

avatar image
REFINITIV
Answer by zoya faberov · May 13 at 05:37 PM

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?

Comment

People who like this

0 Show 2 · 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
vlad.dimanshteyn · May 13 at 06:00 PM 0
Share
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.
avatar image
vlad.dimanshteyn · May 13 at 06:13 PM 0
Share

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.

avatar image
REFINITIV
Answer by zoya faberov · May 13 at 08:23 PM

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:

saltim.gif

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:

points.gif

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.



saltim.gif (5.5 KiB)
points.gif (10.5 KiB)
Comment

People who like this

0 Show 2 · 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
vlad.dimanshteyn · May 13 at 09:00 PM 0
Share
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, Vlad
avatar image
vlad.dimanshteyn · May 13 at 09:23 PM 0
Share

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

avatar image
REFINITIV
Answer by zoya faberov · May 13 at 10:28 PM

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

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 >
11 People are following this question.

Related Questions

Python API - calling historical vessel data

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • 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
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges