How to get exchange/venue holidays?

Options
dqw
dqw Newcomer

Hello,

I would like to get the list of holidays given a specific exchange, wondering where and how I can find this information.

Alternatively, it would also be fine if I can retrieve whether it is a trading day given a specific stock and a specific date.

I ask this because during my discovery, I can only find calendars based on ccy and reigon and historical data for in instrument's activity.

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @dqw

    For that one, the code will be like this:

    fields = []
    for i in range(1,26):
        fields.append(f"ROW80_{i}")
        
    df = ld.get_data(
        universe = ['US/HOLIDAY'],
        fields = fields)
    df.transpose()
    
    image.png

    However, the holiday is in a string format. It may be difficult to parse those dates.

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @dqw

    Thank you for reaching out to us.

    Please confirm the LSEG products or APIs that you are using.

    If you use the LSEG Workspace, you can use the LSEG Data Library for Python to get holidays. The Dates and Calendars API in the LSEG Data Library for Python can return holidays between a start date and an end date using calendar or/and currency codes. For example:

    holidays = ld.dates_and_calendars.holidays(
        start_date="2023-01-01",
        end_date="2023-12-31",
        calendars=["USA", "FRA"]
    )
     
    holidays.df
    
    image.png

    You can also to the sample code on GitHub.

  • dqw
    dqw Newcomer

    Hi @Jirapongse,

    Thanks for your answer, I'm using the LSEG Workspace and api (trapi), but what you showed with LSEG Data Library for Python will also work for me.

    However, I problem I'm facing is that I'm not sure if this is the exchange holiday schedule I'm looking for, it seems to be the national holiday?

    so really the two kinds of corner cases for me would be:

    1. Stock exchange holidays differ from national or public holidays
      NSE: Columbus Day & Veterans Day; SGX: Hari Raya Haji
    2. Exchanges that don't follow the calendar of their country
      HKEX; NYSE Euronext; BIST
  • Hi @dqw ,

    Thank you for posting the question in this forum. However, this forum is dedicated to an API usage question hence, the moderators on this forum do not have deep expertise in every type of content available through our products, such as the exchange holiday schedule. Such expertise is available through the Helpdesk, which can be reached via MyAccount then the support team is going to contact you directly to assist with this.

  • dqw
    dqw Newcomer

    Hi @raksina.samasiri @Jirapongse,

    After communicating with helpdesk, allow me to rephrase my questions, how do I get the equivalent data of the 'World Exchange Holidays' app, and especially for Partial day closure and Full day closure holiday type, and not public holidays.

    I suppose it would also work if the above data could include data holiday type.

    for your reference: https://myaccount.lseg.com/en/faqs/2019/08/000178233

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    You may check the answers on this discussion.

  • dqw
    dqw Newcomer

    @Jirapongse

    Thanks again for the answer,
    what I'm looking for is something more like this:
    https://community.developers.refinitiv.com/discussion/65255/is-there-a-way-to-get-holiday-calendar-for-markets-instrumen-wise-or-general-using-java-api

    but this page is really old, anything more recent?

  • dqw
    dqw Newcomer

    Hi @Jirapongse,

    Thanks for the help! This is really useful. one last question, will it be possible to fetch not just the current year, in this format(with GENERAL INFORMATION)?

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @dqw

    With this method (US/HOLIDAY), it appears that it only returns data for the current year

  • dqw
    dqw Newcomer

    @Jirapongse in that case, would you mind providing the endpoint for the elektron API for this data? I don't seem to find it in the api playground

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @dqw

    The data is from the streaming real-time service.

    It is the same data displayed in the Quote App.

    image.png