# Get Market Status of Securities

get_market_state(code_list)

  • Description

    Get market status of underlying security

  • Parameters

    Parameter Type Description
    code_list list A list of security codes that need to query for market status.
  • Return

    Field Type Description
    ret RET_CODE Interface result.
    data pd.DataFrame If ret == RET_OK, market status data is returned.
    str If ret != RET_OK, error description is returned.
    • Market status data format as follows:
      Field Type Description
      code str Security code.
      stock_name str Security name.
      market_state MarketState Market state.
  • Example

from futu import *
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

ret, data = quote_ctx.get_market_state(['SZ.000001', 'HK.00700'])
if ret == RET_OK:
    print(data)
else:
    print('error:', data)
quote_ctx.close() # After using the connection, remember to close it to prevent the number of connections from running out
1
2
3
4
5
6
7
8
9
  • Output
    code         stock_name   market_state
0  SZ.000001    Ping An Bank  AFTERNOON
1  HK.00700     Tencent       AFTERNOON
1
2
3

Interface Limitations

  • A maximum of 10 requests per 30 seconds
  • The maximum number of stock codes for each request is 400.