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 wyj · Nov 23, 2017 at 12:40 AM · eikoneikon-data-apiworkspacepythonworkspace-data-apirefinitiv-dataplatform-eikontrade

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

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.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Jirapongse · Nov 23, 2017 at 02:24 AM

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
...
Comment
wyj

People who like this

1 Show 5 · 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
wyj · Nov 23, 2017 at 02:56 AM 0
Share

@ 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

avatar image
REFINITIV
Jirapongse ♦♦ wyj · Nov 23, 2017 at 03:26 AM 0
Share

Could you please share the formula used in Excel?

avatar image
wyj Jirapongse ♦♦ · Nov 23, 2017 at 03:28 AM 0
Share

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

avatar image
REFINITIV
pierre.faurel wyj · Dec 07, 2017 at 05:18 AM 0
Share

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

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

Related Questions

How to get all investors for a list of stocks, historically with the python API

Full trade history through API

Trying to fetch Close Bid Price for CMO tranche from Python

Retrieve Commodity Flows data using Python API

What are the possible value of the field TR.INSTRUMENTTRADINGSTATUS

  • 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