How to get trading status of RICs through python api ?
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',]
Alex Putkov
jirapongse.phuriphanvichai
Best Answer
-
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
...1
Answers
-
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
0 -
Could you please share the formula used in Excel?
0 -
=RHistory(""&sssz!B1,".Timestamp;.Open;.Close;.High;.Low","START:2017-10-24 INTERVAL:5M",,"TSREPEAT:NO CH:IN;Fd")
0 -
I am afraid not.
The get_timeseries function only supports these intervals.
'tick', 'minute', 'hour', 'daily', 'weekly', 'monthly', 'quarterly', 'yearly' (Default 'daily')
0 -
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
0
Categories
- All Categories
- 6 AHS
- 37 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 中文论坛