added market open-closed detect

if the market is closed, no query is sent to the server, which can save
the query cap.