marketStatus and, when the market is not open, a reason. Only UNAVAILABLE blocks a trade: an order placed then answers UNAVAILABLE_MARKET. CLOSED is extended-hours trading and can be traded.
The trading day
A stock’s hours follow its chain, andmarketStatus always reflects them: read it rather than a clock. For the stocks offered today, in New York time, on trading days:
Every night from 23:39 to 00:21 is a maintenance window,
UNAVAILABLE. Weekends and market holidays are UNAVAILABLE all day.
Halts
A stock whose price moves sharply is halted, and readsUNAVAILABLE until trading resumes:
Treat a status or a reason you do not recognise as
UNAVAILABLE: values may be added.
Reading it
ReadmarketStatus from the price you are showing, and disable the order button on UNAVAILABLE. A market can become unavailable between the price and the order, so an order can still answer UNAVAILABLE_MARKET: show it as “trading is not available right now”, and let the investor try again when the status changes.