Excluding holidays within ds.get_data call

start_date_qtr = '2021-03-31'

end_date = '2021-06-30'


Return_Series=ds.get_data (tickers='S&PCOMP', fields['PCH(X(RI),-1D)','RI'], start=start_date_qtr, end=end_date, kind=1)


I have the above time series call for Q2 (March 31, 2021-June 30, 2021) and I notice that April 2, 2021 comes up as having zero as return value and the same RI as April 1, 2021 (because April 2, 2021 was Good Friday and the market was closed).

How can i exclude holidays within the get_data call? Or do i have to take care of this with general python functions? Thanks.




Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @jason.miller

    I found the Non-trading days in Datastream article.

    According to that article, the code looks like this:

    Return_Series=ds.get_data (tickers='S&PCOMP', fields=['PCH#(X(RI#S),-1D)','RI#S'], start=start_date_qtr, end=end_date, kind=1)

    However, it is better to contact the Refinitiv Datastream Web Service directly via MyRefinitiv to confirm it.

Answers