Skip to main content

MarketStatus

This interface can tell if equity markets are currently open, partially open, or closed.

MarketStatus.get#

Returns the current open status of the market (U.S. only)

statusdescription
UNKNOWNFailed to determine status for some reason.
FULL_DAYNormal trading day (9:30 AM - 4:00 PM EST)
PARTIAL_1PMEarly closing trading day (9:30 AM - 1:00 PM EST)
AFTER_HOURSAfter market trading (4:00 PM - 7:00 PM EST)
BEFORE_HOURSPre-market hour (6:00 AM? - 9:30 AM)
CLOSEDMarkets are currently closed.
CLOSED_WEEKENDMarkets are closed for the weekend.
var status = MarketStatus.get();
Log.info("Market status: " + status);

MarketStatus.isMarketOpen#

Convenience function to test if the market is open for trading or closed (for whatever reason).

resultdescription
trueMarket is currently open and we can trade.
falseMarket is currently closed. It could be for any reason, we cannot trade.
if (MarketStatus.isMarketOpen()) {
//do some trading
}