event study dates retrieval

Hi, I'm working on an event study and for a given event date, I need to be able to reference 100 datapoints before and 100 datapoints after the event. Ex: Suppose Apple reported earnings on March 1st, I need the start date 100 datapoints ago and the end date 100 datapoints after the event. Notice I said datapoints (trading days) and not calendar days. How would I construct a get_data() statement for that in Python?
Note: I already know about the timedelta() in Python but my understanding is that it doesn't return trading days. I'm looking for a general solution that can be applied to not only equities but also bonds and currencies that might have different trading days than equities.

Thank you in advance.

Tagged:

Best Answer

  • Gurpreet
    Answer ✓

    Hi @srizvi01,

    There is no consolidated source of trading dates for equities, let alone multiple asset class. Only approach I can think of is to request data for more then 100 days, and only take the 100 datapoints of interest (since there will be no data for the dates that didn't trade).