rd.get_history() getting data before start date

rics = 'ABB.ST'
start = '2020-01-01'
end = '2024-02-15'

rd.get_history(universe = rics, fields = "TR.CompanyMarketCap", start = start, end = end)'

I am running the code above and the returned data is as below:

screenshot-2024-05-15-at-092814.png

as start is 2020-01-01 why do I get data for 2019-12-30?

Best Answer

  • Jirapongse
    Answer ✓

    @jn02

    You can use the Python code to filter dates. For example:

    rics = 'ABB.ST'
    start = '2020-01-01'
    end = '2024-02-15' 
    df = rd.get_history(universe  = rics, fields = "TR.CompanyMarketCap", start = start, end = end)
    df[(df.index >= start)]

Answers

  • @jn02

    Thank you for reaching out to us.

    I used the same function in Excel and got the same result.

    =@RDP.Data("ABB.ST","TR.CompanyMarketCap.Date,TR.CompanyMarketCap.calcdate,TR.CompanyMarketCap","Frq=D SDate=2020-01-01 EDate=2024-02-15 CH=Fd RH=IN",B3)

    1715761290249.png

    I assume that it may use the TR.CompanyMarketCap.Calcdate field for the query.

    rics = 'ABB.ST'
    start = '2020-01-01'
    end = '2024-02-15'
     
    rd.get_history(universe  = rics, 
                   fields = ["TR.CompanyMarketCap.date",
                             "TR.CompanyMarketCap.Calcdate",
                             "TR.CompanyMarketCap"], 
                   start = start, end = end)

    1715761370791.png

    Please contact the helpdesk support team directly via MyRefinitiv to confirm this.


  • So how should I adjust my code?
  • Hi @jn02 ,

    For this field, the function seems to only use calc date as what it got from start-end parameters.

    As this is also reflect in the Excel formula, you can contact the helpdesk support as mentioned by my teammate if they have any suggested workaround.

  • So I did not get an answer regarding my question about a work around