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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 2 4

How do I get whether a day is a trading day from the Eikon Api?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

1 Answer

Upvote
Accepted
9.5k 10 5 7

Hello @yuyang

From my finding, one possible way is from the answer of this question, you can use Timeseries / Date functionality available in pandas data frame. This example adds a column to the data frame containing dates adjusted to weekdays:

df = ek.get_timeseries('PTT.BK','CLOSE',interval='daily',start_date='2020-05-01') 

from pandas.tseries.offsets import * 

df['Trading Day'] = df.index + Day(1) - BDay(1) 

df

The example output shows trading day of PTT.BK which is a RIC in The Stock Exchange of Thailand:


tradingdays.png (16.8 KiB)
icon clock
10 |1500

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

Click below to post an Idea Post Idea