Exchange trading schedules peculiarities
A typical hedge fund today needs to diversify its portfolio in a number of ways, one being distributing its assets geographically. That means trading instruments on major exchanges in the US, Europe and Asia-Pacific.
Each exchange has its own local holidays and trading schedule, so that data needs to be fed into fund's trading system in order to place orders only when a given exchange operates. This is usually not an issue, as major financial data providers like Bloomberg and Refinitiv provide these schedules and keep them up to date.
However, there are subtleties. For instance, the Hang Seng Exchange in Hong Kong is closed in an event of typhoon or black rainstorm, and closing times depend on the time the alert is issued. If a trading system sends an order to execute when the exchange is closed, the order will be rejected, potentially triggering an alert in the system and waking up engineers.
There are a few possibilities to avoid the alert. A straightforward solution would be to reimplement the intricate conditions of the closing times based on when the severe weather alert was issued. The exchange takes weather alerts from the Hong Kong Observatory, and one can get the programmatically as well, but there is an easier way. Order rejection messages contain the reason for the rejection in the body of the message, so one can check there to see if the reject is abnormal or due to a closed exchange. Not only it is easier to implement, but also works in case exchange decides to change its closing procedure.
This is not an ideal solution, of course. It would be more correct, for example, to have a realtime API to check whether exchange is open for trading or not and if not, why. Most established exchanges, however, do not offer modern APIs to access such data, so we have to wait for better days.