Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 5 2 7

How to get trading status of RICs through python api ?

@alex

when i run the below codes

start=time.strftime("%Y-%m-%dT01:29:00",time.localtime(time.time()))
end=time.strftime("%Y-%m-%dT07:00:00",time.localtime(time.time()))
df=ek.get_timeseries(['000001.SZ','600781.SS'],fields=["Open","High","Low","Close","Volume"], start_date = start,end_date =end,interval='minute')

I get the result like this: "ERROR"

('600781.SS', ': ', 'Error: TSINoDataAvailable, ErrorCode: TA-TSINoDataAvailable, Fault: TSIError, Description: No data available for the requested date range', '\n')

and I know the reason is that RIC(600781.SS) is suspended on Nov-23-2017。

Is there a function to calculate fun(600781.SS) 's trading status ,for example I hava a code list like this

lst=['000001.SZ',
 '000002.SZ',
 '000004.SZ',
 '000005.SZ',
 '000008.SZ',
 '000009.SZ',
 '000010.SZ',
 '000011.SZ',
 '000012.SZ',
 '000014.SZ',
 '000016.SZ',
 '000017.SZ',
 '000018.SZ',
 '000020.SZ',
 '000021.SZ',
 '000022.SZ',
 '000023.SZ',
 '000025.SZ',]
if there is a function to get trading status , I can avoid upper "ERROR"s when I try to get data .Thanks a lot!@ Alex Putkov @ jirapongse.phuriphanvichai
eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apitrade
icon clock
10 |1500

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

1 Answer

· Write an Answer
Upvote
Accepted
78.1k 246 52 72

You can try this one:

df = ek.get_data(['600781.SS', '000001.SZ', '000002.SZ', '000004.SZ', '000005.SZ', '000008.SZ', '000009.SZ', '000010.SZ', '000011.SZ', '000012.SZ', '000014.SZ', '000016.SZ', '000017.SZ', '000018.SZ', '000020.SZ', '000021.SZ', '000022.SZ', '000023.SZ', '000025.SZ'], ["PRC_QL_CD"])

The result is:

(   Instrument PRC_QL_CD
 0   600781.SS       SDL
 1   000001.SZ          
 2   000002.SZ          
 3   000004.SZ          
 4   000005.SZ          
 5   000008.SZ          
 6   000009.SZ          
 7   000010.SZ          
 8   000011.SZ          
 9   000012.SZ          
 10  000014.SZ          
 11  000016.SZ          
 12  000017.SZ          
 13  000018.SZ          
 14  000020.SZ       SUS
 15  000021.SZ          
 16  000022.SZ       SUS
 17  000023.SZ          
 18  000025.SZ          , None)

The above code shows the value of PRC_QL_CD which is a real-time field.

The definition of this field is defined in the RDMFieldDictionary file.

PRC_QL_CD  "PRICE CODE"           118  NULL        ENUMERATED    3 ( 3 )  ENUM             1
!
! Price qualifier code for equities, bonds, and options, generally related to the 
! quote price.

It is an enumerated field. Its values are defined in the enumtype.def file.

PRC_QL_CD    118
!
! VALUE      DISPLAY   MEANING
! -----      -------   -------
      0        "   "   normal market or not allocated
...
     19        "SDL"   instrument suspended while drawing of lots takes place
...
     54        "SUS"   Suspended
...
     94        "CLS"   Market closed
...
icon clock
10 |1500

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

@ jirapongse.phuriphanvichai

Yeah, that's exactly what i want, thanks very much!

Further Question:

df=ek.get_timeseries(['000001.SZ','600781.SS'],fields=["Open","High","Low","Close","Volume"], start_date = start,end_date =end,interval='minute')
interval='minute'

I saw the parameters ["PRC_QL_CD"]is same as in Eikon Excel, and i know the parameters interval='minute' can be set to "5M" in excel , I don't know if it can be used here "interval='5M'", so I won't retrieve so much data and process them from 1min to 5min, thanks again

Could you please share the formula used in Excel?

=RHistory(""&sssz!B1,".Timestamp;.Open;.Close;.High;.Low","START:2017-10-24 INTERVAL:5M",,"TSREPEAT:NO CH:IN;Fd")

Show more comments

Hi,

You'll find a short python code to aggregate timeseries from 1 minute to 5 minute interval here : https://community.developers.refinitiv.com/questions/20853/is-there-an-interval-type-30-minutes-for-python-ap.html

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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