iosobjective-cios5

How to test if the stock market (NYSE) is currently open/closed?


I am writing a stock market-related app, and would like to include an indicator of whether the stock market (NYSE) is currently open/closed. The Apple "Stocks" app on the iPhone includes this information. I figure the Stocks app is testing something from Yahoo since the quotes are from there and they link to Yahoo finance directly. However, for all my searching around both YQL, Stack Overflow, and the web I can't find a direct query.

Is there a way to query whether the NYSE is currently open/closed?


Solution

  • As provided by wikipedia

    The NYSE is open for trading Monday through Friday between 9:30 am – 4:00 pm ET, with the exception of holidays declared by the Exchange in advance.

    You can easily hard code this or have a table in a DB with the holidays populated. Then use the time and time zone of the device to see if the NYSE is open or closed.