Pull Closing Prices Without Market Holidays

Hello, with this request in Excel using PI#S and DN (A2 = S&PCOMP ticker):


=@DSGRID(Data!$A$2,"X(PI#S)","2021-12-31","","DN","RowHeader=true;ColHeader=true;DispSeriesDescription=false;YearlyTSFormat=false;QuarterlyTSFormat=false;AutoRefresh=false","")

I am able to pull the S&P 500 last value excluding holidays (dates).

How I can translate this method in python code for CodeBook ? Could you provide an example that matches the same output I obtain in Excel ?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @Aleniles

    You can try this one:

    ds.get_data(tickers="@AMZN",fields =["PO", "PH","PL","P#S"], freq="DN", kind=1)

    However, please contact the Refinitiv Datastream Web Service support team directly via MyRefinitiv to confirm it and ask for the way to obtain market holidays (dates) in Datastream for a given country.


Answers